mirror of
https://github.com/tcsenpai/youlama.git
synced 2025-06-07 03:35:41 +00:00
fixed dropdown
This commit is contained in:
parent
b1de04be5c
commit
2f11b6c41b
29
app.py
29
app.py
@ -232,13 +232,20 @@ def create_interface():
|
|||||||
gr.Warning(
|
gr.Warning(
|
||||||
"Ollama is not available. Please check your Ollama server."
|
"Ollama is not available. Please check your Ollama server."
|
||||||
)
|
)
|
||||||
return False, False
|
return False
|
||||||
return checked, checked
|
return checked
|
||||||
|
|
||||||
|
def update_model_visibility(visible):
|
||||||
|
return gr.Dropdown.update(visible=visible)
|
||||||
|
|
||||||
summarize_checkbox.change(
|
summarize_checkbox.change(
|
||||||
fn=toggle_summary,
|
fn=toggle_summary,
|
||||||
inputs=[summarize_checkbox],
|
inputs=[summarize_checkbox],
|
||||||
outputs=[summarize_checkbox, ollama_model_dropdown],
|
outputs=[summarize_checkbox],
|
||||||
|
).then(
|
||||||
|
fn=update_model_visibility,
|
||||||
|
inputs=[summarize_checkbox],
|
||||||
|
outputs=[ollama_model_dropdown],
|
||||||
)
|
)
|
||||||
transcribe_btn = gr.Button("Transcribe", variant="primary")
|
transcribe_btn = gr.Button("Transcribe", variant="primary")
|
||||||
|
|
||||||
@ -337,16 +344,20 @@ def create_interface():
|
|||||||
gr.Warning(
|
gr.Warning(
|
||||||
"Ollama is not available. Please check your Ollama server."
|
"Ollama is not available. Please check your Ollama server."
|
||||||
)
|
)
|
||||||
return False, False
|
return False
|
||||||
return checked, checked
|
return checked
|
||||||
|
|
||||||
|
def update_yt_model_visibility(visible):
|
||||||
|
return gr.Dropdown.update(visible=visible)
|
||||||
|
|
||||||
yt_summarize_checkbox.change(
|
yt_summarize_checkbox.change(
|
||||||
fn=toggle_yt_summary,
|
fn=toggle_yt_summary,
|
||||||
inputs=[yt_summarize_checkbox],
|
inputs=[yt_summarize_checkbox],
|
||||||
outputs=[
|
outputs=[yt_summarize_checkbox],
|
||||||
yt_summarize_checkbox,
|
).then(
|
||||||
yt_ollama_model_dropdown,
|
fn=update_yt_model_visibility,
|
||||||
],
|
inputs=[yt_summarize_checkbox],
|
||||||
|
outputs=[yt_ollama_model_dropdown],
|
||||||
)
|
)
|
||||||
yt_process_btn = gr.Button("Process Video", variant="primary")
|
yt_process_btn = gr.Button("Process Video", variant="primary")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user