chore: config base url
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||
import { ListItem as UserListItem } from '@/pages/users/config/types';
|
||||
import { downloadFile, listFiles, listModels } from '@huggingface/hub';
|
||||
import { PipelineType } from '@huggingface/tasks';
|
||||
@@ -154,10 +155,9 @@ export async function queryModelInstanceLogs(id: number) {
|
||||
|
||||
// ===================== call huggingface quicksearch api =====================
|
||||
|
||||
const MODEL_SCOPE_LIST_MODEL_API =
|
||||
'https://www.modelscope.cn/api/v1/dolphin/models';
|
||||
const MODEL_SCOPE_LIST_MODEL_API = `https://www.modelscope.cn/api/${GPUSTACK_API_BASE_URL}/dolphin/models`;
|
||||
|
||||
const MODE_SCOPE_MODEL_FIELS_API = 'https://modelscope.cn/api/v1/models/';
|
||||
const MODE_SCOPE_MODEL_FIELS_API = `https://modelscope.cn/api/${GPUSTACK_API_BASE_URL}/models/`;
|
||||
|
||||
export async function queryHuggingfaceModelDetail(
|
||||
params: { repo: string },
|
||||
|
||||
@@ -2,6 +2,7 @@ import AutoTooltip from '@/components/auto-tooltip';
|
||||
import CopyButton from '@/components/copy-button';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import ScrollerModal from '@/components/scroller-modal';
|
||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||
import { BulbOutlined } from '@ant-design/icons';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { Button, Tag } from 'antd';
|
||||
@@ -10,6 +11,8 @@ import { useMemo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { modelCategoriesMap } from '../config';
|
||||
|
||||
const GPUSTACK_API = GPUSTACK_API_BASE_URL;
|
||||
|
||||
const ApiAccessInfoWrapper = styled.div`
|
||||
display: grid;
|
||||
padding-left: 20px;
|
||||
@@ -64,7 +67,7 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
||||
const intl = useIntl();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const endPoint = `${window.location.origin}/v1`;
|
||||
const endPoint = `${window.location.origin}/${GPUSTACK_API}`;
|
||||
|
||||
const isRanker = useMemo(() => {
|
||||
return _.includes(data.categories, modelCategoriesMap.reranker);
|
||||
|
||||
@@ -2,6 +2,7 @@ import IconFont from '@/components/icon-font';
|
||||
import MarkdownViewer from '@/components/markdown-viewer';
|
||||
import SimpleOverlay from '@/components/simple-overlay';
|
||||
import ThemeTag from '@/components/tags-wrapper/theme-tag';
|
||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||
import useRequestToken from '@/hooks/use-request-token';
|
||||
import {
|
||||
DownOutlined,
|
||||
@@ -277,7 +278,7 @@ const ModelCard: React.FC<{
|
||||
return '';
|
||||
}
|
||||
if (modelSource === modelSourceMap.modelscope_value) {
|
||||
return `https://modelscope.cn/api/v1/models/${modelData?.name}/repo?Revision=${modelData?.Revision}&View=true&FilePath=${imgSrc}`;
|
||||
return `https://modelscope.cn/api/${GPUSTACK_API_BASE_URL}/models/${modelData?.name}/repo?Revision=${modelData?.Revision}&View=true&FilePath=${imgSrc}`;
|
||||
}
|
||||
if (modelSource === modelSourceMap.huggingface_value) {
|
||||
return `https://huggingface.co/${modelData?.id}/resolve/main/${imgSrc}`;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { modelNameReg } from '@/config';
|
||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||
import useAppUtils from '@/hooks/use-app-utils';
|
||||
import {
|
||||
ClusterStatusLabelMap,
|
||||
@@ -149,7 +150,7 @@ const BasicForm: React.FC<BasicFormProps> = (props) => {
|
||||
required
|
||||
description={intl.formatMessage(
|
||||
{ id: 'models.form.replicas.tips' },
|
||||
{ api: `${window.location.origin}/v1` }
|
||||
{ api: `${window.location.origin}/${GPUSTACK_API_BASE_URL}` }
|
||||
)}
|
||||
min={0}
|
||||
></SealInput.Number>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import AutoTooltip from '@/components/auto-tooltip';
|
||||
import DropdownButtons from '@/components/drop-down-buttons';
|
||||
import { SealColumnProps } from '@/components/seal-table/types';
|
||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Tooltip } from 'antd';
|
||||
@@ -74,7 +75,7 @@ const useModelsColumns = ({
|
||||
<Tooltip
|
||||
title={intl.formatMessage(
|
||||
{ id: 'models.form.replicas.tips' },
|
||||
{ api: `${window.location.origin}/v1` }
|
||||
{ api: `${window.location.origin}/${GPUSTACK_API_BASE_URL}` }
|
||||
)}
|
||||
>
|
||||
<span style={{ fontWeight: 'var(--font-weight-medium)' }}>
|
||||
|
||||
Reference in New Issue
Block a user