Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: switch model caused app crash #1597

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading