chore: embedding model
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
||||
} from '@ant-design/icons';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { Access, useAccess, useIntl, useNavigate } from '@umijs/max';
|
||||
import { Button, Input, Space, message } from 'antd';
|
||||
import { Button, Input, Space, Tag, message } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import _ from 'lodash';
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
@@ -336,10 +336,17 @@ const Models: React.FC<ModelsProps> = ({
|
||||
span={6}
|
||||
render={(text, record: ListItem) => {
|
||||
return (
|
||||
<span>
|
||||
{record.source === modelSourceMap.huggingface_value
|
||||
? `${modelSourceMap.huggingface} / ${record.huggingface_filename}`
|
||||
: `${modelSourceMap.ollama_library} / ${record.ollama_library_model_name}`}
|
||||
<span className="flex flex-column">
|
||||
<span>
|
||||
{record.source === modelSourceMap.huggingface_value
|
||||
? `${modelSourceMap.huggingface} / ${record.huggingface_filename}`
|
||||
: `${modelSourceMap.ollama_library} / ${record.ollama_library_model_name}`}
|
||||
</span>
|
||||
<span>
|
||||
{record.embedding_only && (
|
||||
<Tag style={{ marginTop: 6 }}>Embedding Only</Tag>
|
||||
)}
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
}}
|
||||
@@ -376,7 +383,6 @@ const Models: React.FC<ModelsProps> = ({
|
||||
key="operation"
|
||||
dataIndex="operation"
|
||||
render={(text, record) => {
|
||||
console.log('record====9999', record);
|
||||
return (
|
||||
<DropdownButtons
|
||||
items={setActionList(record)}
|
||||
|
||||
@@ -4,6 +4,7 @@ export interface ListItem {
|
||||
huggingface_file_name: string;
|
||||
huggingface_filename: string;
|
||||
ollama_library_model_name: string;
|
||||
embedding_only?: boolean;
|
||||
ready_replicas: number;
|
||||
replicas: number;
|
||||
s3Address: string;
|
||||
|
||||
@@ -11,6 +11,9 @@ export async function execChatCompletions(params: any) {
|
||||
});
|
||||
}
|
||||
|
||||
export const queryModelsList = async () => {
|
||||
return request(`${OPENAI_MODELS}`);
|
||||
export const queryModelsList = async (params: any) => {
|
||||
return request(`${OPENAI_MODELS}`, {
|
||||
method: 'GET',
|
||||
params
|
||||
});
|
||||
};
|
||||
|
||||
@@ -43,7 +43,10 @@ const ParamsSettings: React.FC<ParamsSettingsProps> = ({
|
||||
useEffect(() => {
|
||||
const getModelList = async () => {
|
||||
try {
|
||||
const res = await queryModelsList();
|
||||
const params = {
|
||||
embedding_only: false
|
||||
};
|
||||
const res = await queryModelsList(params);
|
||||
const list = _.map(res.data || [], (item: any) => {
|
||||
return {
|
||||
value: item.id,
|
||||
|
||||
Reference in New Issue
Block a user