Update app.py
Browse files
app.py
CHANGED
|
@@ -33,13 +33,15 @@ def process_speech_deepseek(audio):
|
|
| 33 |
fp.seek(0)
|
| 34 |
return ipd.Audio(fp.read(), autoplay=True)
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
gr.Interface(
|
| 38 |
-
fn=
|
| 39 |
-
|
| 40 |
-
[process_text_deepseek, process_speech_deepseek]
|
| 41 |
-
],
|
| 42 |
-
inputs="text",
|
| 43 |
outputs=["text", "audio"],
|
| 44 |
live=True
|
| 45 |
).launch()
|
|
|
|
| 33 |
fp.seek(0)
|
| 34 |
return ipd.Audio(fp.read(), autoplay=True)
|
| 35 |
|
| 36 |
+
def main(input_text):
|
| 37 |
+
if input_text[1]:
|
| 38 |
+
return process_text_deepseek(input_text[0]), process_speech_deepseek(input_text[0])
|
| 39 |
+
else:
|
| 40 |
+
return process_text_codellama(input_text[0]), process_speech_codellama(input_text[0])
|
| 41 |
|
| 42 |
gr.Interface(
|
| 43 |
+
fn=main,
|
| 44 |
+
inputs=["text", "checkbox"], # ["input text", "enable voice input"]
|
|
|
|
|
|
|
|
|
|
| 45 |
outputs=["text", "audio"],
|
| 46 |
live=True
|
| 47 |
).launch()
|