Skip to content

Commit

Permalink
fix(gui): handle missing prompts when parsing tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Dec 21, 2023
1 parent a3fad5c commit 7132f10
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gui/src/components/input/PromptInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ export function PromptTextBlock(props: PromptTextBlockProps) {
}

const tokens = useMemo(() => {
const networks = extractNetworks(prompt);
return getNetworkTokens(models, networks);
if (doesExist(prompt)) {
const networks = extractNetworks(prompt);
return getNetworkTokens(models, networks);
}

return [];
}, [models, prompt]);

return <Stack spacing={2}>
Expand Down

0 comments on commit 7132f10

Please sign in to comment.