Spaces:
Runtime error
Runtime error
update gradio
Browse files
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: π
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
|
|
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
app.py
CHANGED
|
@@ -1,23 +1,20 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
| 14 |
-
gr.Markdown("# New Audio Streaming In π€")
|
| 15 |
-
inp = gr.Audio(sources=["microphone"], type="filepath")
|
| 16 |
-
out = gr.Audio(type="filepath", autoplay=True)
|
| 17 |
-
transcription = gr.State(value="")
|
| 18 |
-
clear = gr.Button("Clear")
|
| 19 |
-
|
| 20 |
-
inp.stream(transcribe, [inp, transcription], [out, transcription], time_limit=10, stream_every=1)
|
| 21 |
-
|
| 22 |
-
if __name__ == "__main__":
|
| 23 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def pass_audio(audio, test):
|
| 4 |
+
if test is not None:
|
| 5 |
+
print(len(test))
|
| 6 |
+
print(test[0])
|
| 7 |
+
print(len(test[1]))
|
| 8 |
+
print(test[1])
|
| 9 |
+
else:
|
| 10 |
+
print("test is None")
|
| 11 |
+
return audio, test
|
| 12 |
|
| 13 |
+
demo = gr.Interface(
|
| 14 |
+
pass_audio,
|
| 15 |
+
["state", gr.Audio(sources=["microphone"], streaming=True)],
|
| 16 |
+
["state", gr.Audio(streaming=True, autoplay=True)],
|
| 17 |
+
live=True,
|
| 18 |
+
)
|
| 19 |
|
| 20 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|