chore: hf api use proxy

This commit is contained in:
jialin
2024-11-20 17:51:28 +08:00
parent 66e506db07
commit 22f90a505c
6 changed files with 50 additions and 44 deletions
@@ -131,6 +131,15 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
form.setFieldValue('backend_parameters', list);
}, []);
const handleBackendChange = useCallback((val: string) => {
if (val === backendOptionsMap.llamaBox) {
form.setFieldsValue({
distributed_inference_across_workers: true,
cpu_offloading: true
});
}
}, []);
const collapseItems = useMemo(() => {
const children = (
<>
@@ -239,6 +248,7 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
)}
<Form.Item name="backend">
<SealSelect
onChange={handleBackendChange}
label={intl.formatMessage({ id: 'models.form.backend' })}
options={[
{
+30 -22
View File
@@ -289,31 +289,39 @@ const ModelCard: React.FC<{
)}
</div>
) : (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
style={{ marginBlock: 20 }}
></Empty>
<>
{!loading && (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
style={{ marginBlock: 20 }}
></Empty>
)}
</>
)}
</div>
{!isGGUFModel && readmeText && (
<div>
<TitleWrapper>
<div className="title">README.md</div>
</TitleWrapper>
<div className="card-wrapper">
<Spin spinning={loading}>
<MarkdownViewer
generateImgLink={
modelSource === modelSourceMap.modelscope_value
? generateModeScopeImgLink
: undefined
}
content={readmeText}
theme="light"
></MarkdownViewer>
</Spin>
{!isGGUFModel && (
<Spin spinning={loading}>
<div style={{ minHeight: 200 }}>
{readmeText && (
<>
<TitleWrapper>
<div className="title">README.md</div>
</TitleWrapper>
<div className="card-wrapper">
<MarkdownViewer
generateImgLink={
modelSource === modelSourceMap.modelscope_value
? generateModeScopeImgLink
: undefined
}
content={readmeText}
theme="light"
></MarkdownViewer>
</div>
</>
)}
</div>
</div>
</Spin>
)}
</>
);
+1 -4
View File
@@ -461,10 +461,7 @@ const Models: React.FC<ModelsProps> = ({
return `${modelSourceMap.huggingface}/${record.huggingface_repo_id}`;
}
if (record.source === modelSourceMap.local_path_value) {
const localPath = _.startsWith(record.local_path, '/')
? record.local_path
: `/${record.local_path}`;
return `${modelSourceMap.local_path}${localPath}`;
return `${record.local_path}`;
}
if (record.source === modelSourceMap.ollama_library_value) {
return `${modelSourceMap.ollama_library}/${record.ollama_library_model_name}`;