Skip to content

Commit

Permalink
fix: switch model caused app crash (janhq#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan authored Jan 15, 2024
1 parent aaa02b5 commit 81ad936
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/containers/DropdownListSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export default function DropdownListSidebar() {

const { recommendedModel, downloadedModels } = useRecommendedModel()

const selectedName =
downloadedModels.filter((x) => x.id === selected?.id)[0]?.name ?? ''
/**
* Default value for max_tokens and ctx_len
* Its to avoid OOM issue since a model can set a big number for these settings
Expand Down Expand Up @@ -208,7 +210,7 @@ export default function DropdownListSidebar() {
<Select value={selected?.id} onValueChange={onValueSelected}>
<SelectTrigger className="w-full">
<SelectValue placeholder="Choose model to start">
{downloadedModels.filter((x) => x.id === selected?.id)[0]?.name}
{selectedName}
</SelectValue>
</SelectTrigger>
<SelectContent className="right-2 block w-full min-w-[450px] pr-0">
Expand Down

0 comments on commit 81ad936

Please sign in to comment.