Skip to content

Commit

Permalink
fix: Add model by ollama in model provider page, user can't choose th…
Browse files Browse the repository at this point in the history
…e model in chat window. #2479 (#2529)

### What problem does this PR solve?

fix: Add model by ollama in model provider page, user can't choose the
model in chat window. #2479

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
cike8899 authored Sep 23, 2024
1 parent d8a4341 commit f6ceb43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions web/src/components/llm-select/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { LlmModelType } from '@/constants/knowledge';
import { useSelectLlmOptionsByModelType } from '@/hooks/llm-hooks';
import { Popover, Select } from 'antd';
import LlmSettingItems from '../llm-setting-items';

Expand All @@ -8,6 +10,8 @@ interface IProps {
}

const LLMSelect = ({ id, value, onChange }: IProps) => {
const modelOptions = useSelectLlmOptionsByModelType();

const content = (
<div style={{ width: 400 }}>
<LlmSettingItems
Expand All @@ -25,6 +29,10 @@ const LLMSelect = ({ id, value, onChange }: IProps) => {
destroyTooltipOnHide
>
<Select
options={[
...modelOptions[LlmModelType.Chat],
...modelOptions[LlmModelType.Image2text],
]}
style={{ width: '100%' }}
dropdownStyle={{ display: 'none' }}
id={id}
Expand Down
2 changes: 1 addition & 1 deletion web/src/hooks/llm-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const useSelectLlmOptionsByModelType = () => {
)
.map((x) => ({
label: x.llm_name,
value: x.llm_name,
value: `${x.llm_name}@${x.fid}`,
disabled: !x.available,
})),
};
Expand Down

0 comments on commit f6ceb43

Please sign in to comment.