chore: config base url
This commit is contained in:
@@ -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}`;
|
||||
|
||||
Reference in New Issue
Block a user