From 8e05f3c36023aac6312a1b7b556f74c6d0858589 Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 25 Dec 2023 16:56:46 +0800 Subject: [PATCH] chore --- exportModelsJson.js | 4 ++-- frontend/src/_locales/ja/main.json | 2 ++ frontend/src/_locales/zh-hans/main.json | 2 ++ frontend/src/pages/Models.tsx | 5 +++-- frontend/src/types/models.ts | 12 +++++++----- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/exportModelsJson.js b/exportModelsJson.js index ae60644..bbcdf31 100644 --- a/exportModelsJson.js +++ b/exportModelsJson.js @@ -25,8 +25,8 @@ document.querySelectorAll('.grid.h-10.grid-cols-12.place-content-center.gap-x-3. data.size = parseInt(extractValue(rawText, 'size')) data.SHA256 = extractValue(rawText, 'oid sha256:') data.lastUpdated = e.children[3].children[0].getAttribute('datetime') - data.url = e.children[1].href.replace('/resolve/', '/blob/') - data.downloadUrl = e.children[1].href + data.url = e.children[1].href.replace('/resolve/', '/blob/').replace('?download=true', '') + data.downloadUrl = e.children[1].href.replace('?download=true', '') data.tags = [] modelsJson.push(data) diff --git a/frontend/src/_locales/ja/main.json b/frontend/src/_locales/ja/main.json index 07c04ad..0d3cd11 100644 --- a/frontend/src/_locales/ja/main.json +++ b/frontend/src/_locales/ja/main.json @@ -312,6 +312,8 @@ "JP": "日本語", "Music": "音楽", "Other": "その他", + "Role Play": "ロールプレイ", + "Recommended": "おすすめ", "Import MIDI": "MIDIをインポート", "Current Instrument": "現在の楽器", "Please convert model to GGML format first": "モデルをGGML形式に変換してください", diff --git a/frontend/src/_locales/zh-hans/main.json b/frontend/src/_locales/zh-hans/main.json index 59f778b..e15b5e5 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -312,6 +312,8 @@ "JP": "日文", "Music": "音乐", "Other": "其他", + "Role Play": "角色扮演", + "Recommended": "推荐", "Import MIDI": "导入MIDI", "Current Instrument": "当前乐器", "Please convert model to GGML format first": "请先将模型转换为GGML格式", diff --git a/frontend/src/pages/Models.tsx b/frontend/src/pages/Models.tsx index 30616fb..0df7f37 100644 --- a/frontend/src/pages/Models.tsx +++ b/frontend/src/pages/Models.tsx @@ -160,8 +160,9 @@ const Models: FC = observer(() => { useEffect(() => { setTags(Array.from(new Set( - [...commonStore.modelSourceList.map(item => item.tags || []).flat() - .filter(i => !i.includes('Other') && !i.includes('Local')) + ['Recommended', + ...commonStore.modelSourceList.map(item => item.tags || []).flat() + .filter(i => !i.includes('Other') && !i.includes('Local')) , 'Other', 'Local']))); }, [commonStore.modelSourceList]); diff --git a/frontend/src/types/models.ts b/frontend/src/types/models.ts index 0fd436a..78b86ea 100644 --- a/frontend/src/types/models.ts +++ b/frontend/src/types/models.ts @@ -1,15 +1,17 @@ export type ModelSourceItem = { name: string; - size: number; - lastUpdated: string; desc?: { [lang: string]: string | undefined; }; + size: number; SHA256?: string; + lastUpdated: string; url?: string; downloadUrl?: string; + tags?: string[]; + customTokenizer?: string; + hide?: boolean; + + lastUpdatedMs?: number; isComplete?: boolean; isLocal?: boolean; localSize?: number; - lastUpdatedMs?: number; - tags?: string[]; - hide?: boolean; }; \ No newline at end of file