Ver 2.7.0 maybe

This commit is contained in:
litagin02
2025-08-24 11:27:27 +09:00
parent 4859d64e9f
commit c51c80fe1a
24 changed files with 173 additions and 33 deletions

View File

@@ -51,6 +51,11 @@ def do_transcribe(
):
if model_name == "":
return "Error: モデル名を入力してください。"
if hf_repo_id == "litagin/anime-whisper":
logger.info(
"Since litagin/anime-whisper does not support initial prompt, it will be ignored."
)
initial_prompt = ""
cmd = [
"transcribe.py",
@@ -159,34 +164,30 @@ def create_dataset_app() -> gr.Blocks:
result1 = gr.Textbox(label="結果")
with gr.Row():
with gr.Column():
use_hf_whisper = gr.Checkbox(
label="HuggingFaceのWhisperを使う速度が速いがVRAMを多く使う",
value=False,
)
whisper_model = gr.Dropdown(
[
"tiny",
"base",
"small",
"medium",
"large",
"large-v2",
"large-v3",
],
label="Whisperモデル",
value="large-v3",
)
use_hf_whisper = gr.Checkbox(
label="HuggingFaceのWhisperを使う速度が速いがVRAMを多く使う",
value=False,
visible=True,
)
hf_repo_id = gr.Dropdown(
[
"openai/whisper-large-v3-turbo",
"openai/whisper-large-v3",
"openai/whisper-large-v2",
"kotoba-tech/kotoba-whisper-v1.1",
"kotoba-tech/kotoba-whisper-v2.1",
"litagin/anime-whisper",
],
label="HuggingFaceのWhisper repo_id",
value="openai/whisper-large-v3",
value="openai/whisper-large-v3-turbo",
visible=False,
)
compute_type = gr.Dropdown(
@@ -258,12 +259,13 @@ def create_dataset_app() -> gr.Blocks:
)
use_hf_whisper.change(
lambda x: (
gr.update(visible=not x),
gr.update(visible=x),
gr.update(visible=x),
gr.update(visible=not x),
),
inputs=[use_hf_whisper],
outputs=[hf_repo_id, batch_size, compute_type],
outputs=[whisper_model, hf_repo_id, batch_size, compute_type],
)
return app