chore: update /v1-openai to /v1 in playground test code

This commit is contained in:
jialin
2025-02-25 16:10:40 +08:00
parent e1959f74aa
commit 600f457bc2
7 changed files with 23 additions and 11 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ export default {
'Specify the model directory that contains .safetensors and config.json files, e.g., /usr/local/models/model/.', 'Specify the model directory that contains .safetensors and config.json files, e.g., /usr/local/models/model/.',
'models.localpath.chunks.tips': `Specify the first shard file of the model, e.g., /usr/local/models/model-00001-of-00004.gguf.`, 'models.localpath.chunks.tips': `Specify the first shard file of the model, e.g., /usr/local/models/model-00001-of-00004.gguf.`,
'models.form.replicas.tips': 'models.form.replicas.tips':
'Multiple replicas enable load balancing for /v1-openai inference requests.', 'Multiple replicas enable load balancing for { api } inference requests.',
'models.table.list.empty': 'No Models yet!', 'models.table.list.empty': 'No Models yet!',
'models.table.list.getStart': 'models.table.list.getStart':
'<span style="margin-right: 5px;font-size: 13px;">Get started with</span> <span style="font-size: 14px;font-weight: 700">DeepSeek-R1-Distill-Qwen-1.5B</span>' '<span style="margin-right: 5px;font-size: 13px;">Get started with</span> <span style="font-size: 14px;font-weight: 700">DeepSeek-R1-Distill-Qwen-1.5B</span>'
+1 -1
View File
@@ -99,7 +99,7 @@ export default {
'指向包含 .safetensors, config.json 文件的模型目录,例如 /usr/local/models/model/', '指向包含 .safetensors, config.json 文件的模型目录,例如 /usr/local/models/model/',
'models.localpath.chunks.tips': 'models.localpath.chunks.tips':
'指向模型第一个分片文件,例如 /usr/local/models/model-00001-of-00004.gguf', '指向模型第一个分片文件,例如 /usr/local/models/model-00001-of-00004.gguf',
'models.form.replicas.tips': '多副本数实现 /v1-openai 接口推理请求的负载均衡', 'models.form.replicas.tips': '多副本数实现 { api } 接口推理请求的负载均衡',
'models.table.list.empty': '暂无已部署模型', 'models.table.list.empty': '暂无已部署模型',
'models.table.list.getStart': 'models.table.list.getStart':
'<span style="margin-right: 5px;font-size: 13px;">一键部署</span><span style="font-size: 14px;font-weight: 700">DeepSeek-R1-Distill-Qwen-1.5B</span><span style="margin-left: 5px;font-size: 13px;">立即使用!</span>' '<span style="margin-right: 5px;font-size: 13px;">一键部署</span><span style="font-size: 14px;font-weight: 700">DeepSeek-R1-Distill-Qwen-1.5B</span><span style="margin-left: 5px;font-size: 13px;">立即使用!</span>'
+4 -1
View File
@@ -668,7 +668,10 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
id: 'models.form.replicas' id: 'models.form.replicas'
})} })}
required required
description={intl.formatMessage({ id: 'models.form.replicas.tips' })} description={intl.formatMessage(
{ id: 'models.form.replicas.tips' },
{ api: `${window.location.origin}/v1` }
)}
min={0} min={0}
></SealInput.Number> ></SealInput.Number>
</Form.Item> </Form.Item>
@@ -21,7 +21,7 @@ type AddModalProps = {
open: boolean; open: boolean;
source: string; source: string;
width?: string | number; width?: string | number;
gpuOptions?: any[]; gpuOptions: any[];
onOk: (values: FormData) => void; onOk: (values: FormData) => void;
onCancel: () => void; onCancel: () => void;
}; };
+4 -1
View File
@@ -769,7 +769,10 @@ const Models: React.FC<ModelsProps> = ({
{ {
title: ( title: (
<Tooltip <Tooltip
title={intl.formatMessage({ id: 'models.form.replicas.tips' })} title={intl.formatMessage(
{ id: 'models.form.replicas.tips' },
{ api: `${window.location.origin}/v1` }
)}
> >
{intl.formatMessage({ id: 'models.form.replicas' })} {intl.formatMessage({ id: 'models.form.replicas' })}
<QuestionCircleOutlined className="m-l-5" /> <QuestionCircleOutlined className="m-l-5" />
+10 -4
View File
@@ -380,7 +380,10 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
form={form} form={form}
onFinish={handleOk} onFinish={handleOk}
preserve={false} preserve={false}
initialValues={formData} clearOnDestroy={true}
initialValues={{
...formData
}}
style={{ style={{
padding: 'var(--ant-modal-content-padding)', padding: 'var(--ant-modal-content-padding)',
paddingBlock: 0 paddingBlock: 0
@@ -491,9 +494,12 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
id: 'models.form.replicas' id: 'models.form.replicas'
})} })}
required required
description={intl.formatMessage({ description={intl.formatMessage(
id: 'models.form.replicas.tips' {
})} id: 'models.form.replicas.tips'
},
{ api: `${window.location.origin}/v1` }
)}
min={0} min={0}
></SealInput.Number> ></SealInput.Number>
</Form.Item> </Form.Item>
+2 -2
View File
@@ -1,6 +1,6 @@
import { request } from '@umijs/max'; import { request } from '@umijs/max';
export const OPENAI_COMPATIBLE = 'v1-openai'; export const OPENAI_COMPATIBLE = 'v1';
export const CHAT_API = `/${OPENAI_COMPATIBLE}/chat/completions`; export const CHAT_API = `/${OPENAI_COMPATIBLE}/chat/completions`;
@@ -9,7 +9,7 @@ export const EDIT_IMAGE_API = `/${OPENAI_COMPATIBLE}/images/edits`;
export const EMBEDDING_API = `/${OPENAI_COMPATIBLE}/embeddings`; export const EMBEDDING_API = `/${OPENAI_COMPATIBLE}/embeddings`;
export const OPENAI_MODELS = `/${OPENAI_COMPATIBLE}/models`; export const OPENAI_MODELS = `/v1-openai/models`;
export const RERANKER_API = '/rerank'; export const RERANKER_API = '/rerank';