Skip to content

Commit

Permalink
support sequence2txt and tts model in Xinference
Browse files Browse the repository at this point in the history
  • Loading branch information
JobSmithManipulation committed Sep 30, 2024
1 parent d2fb3f5 commit 7b1428c
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions web/src/pages/user-setting/setting-model/ollama-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ const OllamaModal = ({
const url =
llmFactoryToUrlMap[llmFactory as LlmFactory] ||
'https://github.com/infiniflow/ragflow/blob/main/docs/guides/deploy_local_llm.mdx';
const optionsMap = {
HuggingFace: [{ value: 'embedding', label: 'embedding' }],
Xinference: [
{ value: 'chat', label: 'chat' },
{ value: 'embedding', label: 'embedding' },
{ value: 'rerank', label: 'rerank' },
{ value: 'image2text', label: 'image2text' },
{ value: 'speech2text', label: 'sequence2text' },
{ value: 'tts', label: 'tts' },
],
Default: [
{ value: 'chat', label: 'chat' },
{ value: 'embedding', label: 'embedding' },
{ value: 'rerank', label: 'rerank' },
{ value: 'image2text', label: 'image2text' },
],
};
const getOptions = (factory: string) => {
return optionsMap[factory as keyof typeof optionsMap] || optionsMap.Default;
};
return (
<Modal
title={t('addLlmTitle', { name: llmFactory })}
Expand Down Expand Up @@ -85,18 +105,11 @@ const OllamaModal = ({
rules={[{ required: true, message: t('modelTypeMessage') }]}
>
<Select placeholder={t('modelTypeMessage')}>
{llmFactory === 'HuggingFace' ? (
<Option value="embedding">embedding</Option>
) : (
<>
<Option value="chat">chat</Option>
<Option value="embedding">embedding</Option>
<Option value="rerank">rerank</Option>
<Option value="image2text">image2text</Option>
<Option value="speech2text">sequence2text</Option>
<Option value="tts">tts</Option>
</>
)}
{getOptions(llmFactory).map((option) => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item>
<Form.Item<FieldType>
Expand Down

0 comments on commit 7b1428c

Please sign in to comment.