Gijs Wijngaard
commited on
Commit
·
471da98
1
Parent(s):
b6d8181
add default
Browse files
app.py
CHANGED
@@ -76,7 +76,13 @@ def process_output(output):
|
|
76 |
@spaces.GPU
|
77 |
def process_audio_streaming(audio_file, model_choice):
|
78 |
# Load the selected model
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
model, processor = load_model(model_path)
|
81 |
|
82 |
# Load and process the audio with torchaudio
|
@@ -145,7 +151,7 @@ audio_demo = gr.Interface(
|
|
145 |
fn=process_audio_streaming,
|
146 |
inputs=[
|
147 |
gr.Audio(type="filepath", label="Upload Audio"),
|
148 |
-
gr.Radio(["Think", "Think + Semantics"], label="Select Model", value="
|
149 |
],
|
150 |
outputs=gr.Textbox(label="Generated Output", lines=30),
|
151 |
title="SemThink",
|
|
|
76 |
@spaces.GPU
|
77 |
def process_audio_streaming(audio_file, model_choice):
|
78 |
# Load the selected model
|
79 |
+
if model_choice == "Think":
|
80 |
+
model_path = model_path_1
|
81 |
+
elif model_choice == "Think + Semantics":
|
82 |
+
model_path = model_path_2
|
83 |
+
else: # Default option
|
84 |
+
model_path = base_model_id
|
85 |
+
|
86 |
model, processor = load_model(model_path)
|
87 |
|
88 |
# Load and process the audio with torchaudio
|
|
|
151 |
fn=process_audio_streaming,
|
152 |
inputs=[
|
153 |
gr.Audio(type="filepath", label="Upload Audio"),
|
154 |
+
gr.Radio(["Default", "Think", "Think + Semantics"], label="Select Model", value="Default")
|
155 |
],
|
156 |
outputs=gr.Textbox(label="Generated Output", lines=30),
|
157 |
title="SemThink",
|