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: Add model by ollama in model provider page, user can't choose the model in chat window. #2479 #2529

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
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
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