Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,9 +83,9 @@ def process_audio_text(text, audio):
|
|
| 83 |
|
| 84 |
# 处理音频输入
|
| 85 |
audio_path = process_audio_input(audio)
|
| 86 |
-
|
| 87 |
-
text = ""
|
| 88 |
-
|
| 89 |
tmp = [{
|
| 90 |
"conversations": [
|
| 91 |
{
|
|
@@ -134,14 +134,12 @@ if __name__ == "__main__":
|
|
| 134 |
gr.Audio(type="filepath", label="Upload Audio")
|
| 135 |
],
|
| 136 |
outputs=[
|
| 137 |
-
gr.
|
| 138 |
-
gr.
|
| 139 |
],
|
| 140 |
examples=examples,
|
| 141 |
-
title="🔊 EchoX Assistant",
|
| 142 |
-
description="A multimodal AI assistant that understands speech and responds with both text and audio",
|
| 143 |
live=False,
|
| 144 |
allow_flagging="never"
|
| 145 |
)
|
| 146 |
|
| 147 |
-
iface.launch(server_name="0.0.0.0", server_port=7860
|
|
|
|
| 83 |
|
| 84 |
# 处理音频输入
|
| 85 |
audio_path = process_audio_input(audio)
|
| 86 |
+
|
| 87 |
+
text = "" if not isinstance(text, str) else text
|
| 88 |
+
|
| 89 |
tmp = [{
|
| 90 |
"conversations": [
|
| 91 |
{
|
|
|
|
| 134 |
gr.Audio(type="filepath", label="Upload Audio")
|
| 135 |
],
|
| 136 |
outputs=[
|
| 137 |
+
gr.Audio(label="Streamed Audio", streaming=True, autoplay=True),
|
| 138 |
+
gr.Textbox(label="Model output")
|
| 139 |
],
|
| 140 |
examples=examples,
|
|
|
|
|
|
|
| 141 |
live=False,
|
| 142 |
allow_flagging="never"
|
| 143 |
)
|
| 144 |
|
| 145 |
+
iface.launch(server_name="0.0.0.0", server_port=7860)
|