From 556b667cc074538290c3ac9fa7d7c7a145b3f3d8 Mon Sep 17 00:00:00 2001 From: josc146 Date: Tue, 12 Dec 2023 23:27:19 +0800 Subject: [PATCH] improve prompts --- frontend/src/_locales/ja/main.json | 3 ++- frontend/src/_locales/zh-hans/main.json | 3 ++- frontend/src/components/RunButton.tsx | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/_locales/ja/main.json b/frontend/src/_locales/ja/main.json index e37e9f5..44cd26d 100644 --- a/frontend/src/_locales/ja/main.json +++ b/frontend/src/_locales/ja/main.json @@ -319,5 +319,6 @@ "CPU (rwkv.cpp, Faster)": "CPU (rwkv.cpp, 高速)", "Play With External Player": "外部プレーヤーで再生", "Core API URL": "コアAPI URL", - "Override core API URL(/chat/completions and /completions). If you don't know what this is, leave it blank.": "コアAPI URLを上書きします(/chat/completions と /completions)。何であるかわからない場合は空白のままにしてください。" + "Override core API URL(/chat/completions and /completions). If you don't know what this is, leave it blank.": "コアAPI URLを上書きします(/chat/completions と /completions)。何であるかわからない場合は空白のままにしてください。", + "Please change Strategy to CPU (rwkv.cpp) to use ggml format": "StrategyをCPU (rwkv.cpp)に変更して、ggml形式を使用してください" } \ No newline at end of file diff --git a/frontend/src/_locales/zh-hans/main.json b/frontend/src/_locales/zh-hans/main.json index 5b8f30f..1e4a20f 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -319,5 +319,6 @@ "CPU (rwkv.cpp, Faster)": "CPU (rwkv.cpp, 更快)", "Play With External Player": "使用外部播放器播放", "Core API URL": "核心 API URL", - "Override core API URL(/chat/completions and /completions). If you don't know what this is, leave it blank.": "覆盖核心的 API URL (/chat/completions 和 /completions)。如果你不知道这是什么,请留空" + "Override core API URL(/chat/completions and /completions). If you don't know what this is, leave it blank.": "覆盖核心的 API URL (/chat/completions 和 /completions)。如果你不知道这是什么,请留空", + "Please change Strategy to CPU (rwkv.cpp) to use ggml format": "请将Strategy改为CPU (rwkv.cpp)以使用ggml格式" } \ No newline at end of file diff --git a/frontend/src/components/RunButton.tsx b/frontend/src/components/RunButton.tsx index 8cd5adf..1020c9a 100644 --- a/frontend/src/components/RunButton.tsx +++ b/frontend/src/components/RunButton.tsx @@ -138,6 +138,14 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean } } + if (!cpp) { + if (['.bin'].some(ext => modelPath.endsWith(ext))) { + toast(t('Please change Strategy to CPU (rwkv.cpp) to use ggml format'), { type: 'error' }); + commonStore.setStatus({ status: ModelStatus.Offline }); + return; + } + } + if (!await FileExists(modelPath)) { showDownloadPrompt(t('Model file not found'), modelName); commonStore.setStatus({ status: ModelStatus.Offline });