Skip to content

Commit

Permalink
fix embeddings page
Browse files Browse the repository at this point in the history
  • Loading branch information
aliasaria committed Jan 2, 2024
1 parent 017564d commit 3c04128
Showing 1 changed file with 46 additions and 33 deletions.
79 changes: 46 additions & 33 deletions src/renderer/components/Experiment/Embeddings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Sheet from '@mui/joy/Sheet';
import * as chatAPI from 'renderer/lib/transformerlab-api-sdk';
import { PencilIcon, PlayIcon } from 'lucide-react';
import {
Box,
Button,
FormControl,
FormHelperText,
Expand All @@ -34,48 +35,60 @@ export default function Embeddings({ model_name }) {

embeddings = embeddings.join('\n\n\n');

document.getElementsByName('outputText')[0].value = embeddings;
document.getElementById('embeddingsResult').innerHTML = embeddings;
}

return (
<>
<Sheet>
<Sheet
sx={{
display: 'flex',
flexDirection: 'column',
height: '100%',
marginBottom: '1rem',
paddingBottom: '1rem',
overflowY: 'auto',
overflowX: 'hidden',
padding: '1rem',
}}
>
<Typography level="h1" mb={3}>
Generate Embeddings
</Typography>

<FormControl>
<FormLabel>Input Text</FormLabel>
<Textarea
minRows={8}
size="lg"
defaultValue="This is a line
<div>
<FormControl>
<FormLabel>Input Text</FormLabel>
<Textarea
minRows={8}
size="lg"
defaultValue="This is a line
This is a second line."
name="inputText"
/>

<FormHelperText>
Enter text to convert, one input per line.
</FormHelperText>
</FormControl>
<Button
sx={{ mt: 4, mb: 4 }}
startDecorator={<PlayIcon />}
onClick={async () => await getEmbeddings()}
>
Process Embeddings
</Button>
name="inputText"
/>

<FormControl>
<FormLabel>Output Vectors</FormLabel>
<Textarea
minRows={8}
maxRows={20}
size="lg"
name="outputText"
sx={{ whiteSpace: 'nowrap' }}
/>
</FormControl>
<FormHelperText>
Enter text to convert, one input per line.
</FormHelperText>
</FormControl>
<Button
sx={{ mt: 4, mb: 4 }}
startDecorator={<PlayIcon />}
onClick={async () => await getEmbeddings()}
>
Process Embeddings
</Button>
</div>
<div>
<FormControl>
<FormLabel>Output Vectors</FormLabel>
<Sheet
id="embeddingsResult"
variant="soft"
color="neutral"
sx={{ padding: 1, overflow: 'hidden' }}
/>
</FormControl>
</div>
</Sheet>
</>
);
Expand Down

0 comments on commit 3c04128

Please sign in to comment.