فهرست منبع

Infer UI: Allow choose from common path. (#96)

* Allow inplace transcripting. Fix some bugs. Add options.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update app.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
spicysama 2 سال پیش
والد
کامیت
75a98372b3
1فایلهای تغییر یافته به همراه24 افزوده شده و 5 حذف شده
  1. 24 5
      fish_speech/webui/app.py

+ 24 - 5
fish_speech/webui/app.py

@@ -1,6 +1,7 @@
 import html
 import io
 import traceback
+from pathlib import Path
 
 import gradio as gr
 import librosa
@@ -154,14 +155,32 @@ def build_model_config_block():
                 value=True,
             )
 
-    llama_ckpt_path = gr.Textbox(
-        label="Llama 模型路径", value="checkpoints/text2semantic-400m-v0.2-4k.pth"
+    llama_ckpt_path = gr.Dropdown(
+        label="Llama 模型路径",
+        value=str(Path("checkpoints/text2semantic-400m-v0.3-4k.pth")),
+        choices=[str(pth_file) for pth_file in Path("results").rglob("*text*/*.ckpt")]
+        + [str(pth_file) for pth_file in Path("checkpoints").rglob("*text*.pth")],
+        allow_custom_value=True,
     )
     llama_config_name = gr.Textbox(label="Llama 配置文件", value="text2semantic_finetune")
-    tokenizer = gr.Textbox(label="Tokenizer", value="fishaudio/speech-lm-v1")
+    tokenizer = gr.Dropdown(
+        label="Tokenizer",
+        value="fishaudio/speech-lm-v1",
+        choices=["fishaudio/speech-lm-v1", "checkpoints"],
+    )
 
-    vqgan_ckpt_path = gr.Textbox(label="VQGAN 模型路径", value="checkpoints/vqgan-v1.pth")
-    vqgan_config_name = gr.Textbox(label="VQGAN 配置文件", value="vqgan_pretrain")
+    vqgan_ckpt_path = gr.Dropdown(
+        label="VQGAN 模型路径",
+        value=str(Path("checkpoints/vqgan-v1.pth")),
+        choices=[str(pth_file) for pth_file in Path("results").rglob("*vqgan*/*.ckpt")]
+        + [str(pth_file) for pth_file in Path("checkpoints").rglob("*vqgan*.pth")],
+        allow_custom_value=True,
+    )
+    vqgan_config_name = gr.Dropdown(
+        label="VQGAN 配置文件",
+        value="vqgan_pretrain",
+        choices=["vqgan_pretrain", "vqgan_finetune"],
+    )
 
     load_model_btn = gr.Button(value="加载模型", variant="primary")
     error = gr.HTML(label="错误信息")