diff --git a/backend-golang/rwkv.go b/backend-golang/rwkv.go index e4b3d8b..78e0006 100644 --- a/backend-golang/rwkv.go +++ b/backend-golang/rwkv.go @@ -10,7 +10,7 @@ import ( "strings" ) -func (a *App) StartServer(python string, port int, host string, rwkvBeta bool) (string, error) { +func (a *App) StartServer(python string, port int, host string, webui bool, rwkvBeta bool) (string, error) { var err error if python == "" { python, err = GetPython() @@ -19,6 +19,9 @@ func (a *App) StartServer(python string, port int, host string, rwkvBeta bool) ( return "", err } args := []string{python, "./backend-python/main.py"} + if webui { + args = append(args, "--webui") + } if rwkvBeta { args = append(args, "--rwkv-beta") } diff --git a/frontend/src/_locales/ja/main.json b/frontend/src/_locales/ja/main.json index c115727..a989f30 100644 --- a/frontend/src/_locales/ja/main.json +++ b/frontend/src/_locales/ja/main.json @@ -264,5 +264,6 @@ "The file name is: ": "ファイル名は次のとおりです: ", "Port is occupied. Change it in Configs page or close the program that occupies the port.": "ポートが占有されています。設定ページで変更するか、ポートを占有しているプログラムを終了してください。", "Loading...": "読み込み中...", - "Hello, what can I do for you?": "こんにちは、何かお手伝いできますか?" + "Hello, what can I do for you?": "こんにちは、何かお手伝いできますか?", + "Enable WebUI": "WebUIを有効化" } \ 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 0dac207..569a818 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -264,5 +264,6 @@ "The file name is: ": "文件名是:", "Port is occupied. Change it in Configs page or close the program that occupies the port.": "端口被占用。请在配置页面更改端口,或关闭占用端口的程序", "Loading...": "加载中...", - "Hello, what can I do for you?": "你好,有什么要我帮忙的吗?" + "Hello, what can I do for you?": "你好,有什么要我帮忙的吗?", + "Enable WebUI": "启用WebUI" } \ No newline at end of file diff --git a/frontend/src/components/RunButton.tsx b/frontend/src/components/RunButton.tsx index e313230..142577d 100644 --- a/frontend/src/components/RunButton.tsx +++ b/frontend/src/components/RunButton.tsx @@ -129,7 +129,7 @@ export const RunButton: FC<{ onClickRun?: MouseEventHandler, iconMode?: boolean const isUsingCudaBeta = modelConfig.modelParameters.device === 'CUDA-Beta'; startServer(commonStore.settings.customPythonPath, port, commonStore.settings.host !== '127.0.0.1' ? '0.0.0.0' : '127.0.0.1', - isUsingCudaBeta + !!modelConfig.enableWebUI, isUsingCudaBeta ).catch((e) => { const errMsg = e.message || e; if (errMsg.includes('path contains space')) diff --git a/frontend/src/pages/Configs.tsx b/frontend/src/pages/Configs.tsx index 2960a8c..1f7a0fa 100644 --- a/frontend/src/pages/Configs.tsx +++ b/frontend/src/pages/Configs.tsx @@ -441,7 +441,18 @@ const Configs: FC = observer(() => { />