Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import speech_recognition as sr
|
2 |
from googletrans import Translator
|
3 |
-
from httpcore import SyncHTTPProxy
|
4 |
-
|
5 |
http_proxy = SyncHTTPProxy((b'http', b'myproxy.com', 8080, b''))
|
6 |
proxies = {'http': http_proxy, 'https': http_proxy }
|
7 |
|
@@ -38,4 +38,13 @@ def translate():
|
|
38 |
|
39 |
gr.Interface(
|
40 |
fn=translate,
|
41 |
-
inputs=gr.Audio(source="microphone", type="numpy"), outputs="text").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import speech_recognition as sr
|
2 |
from googletrans import Translator
|
3 |
+
#from httpcore import SyncHTTPProxy
|
4 |
+
"""
|
5 |
http_proxy = SyncHTTPProxy((b'http', b'myproxy.com', 8080, b''))
|
6 |
proxies = {'http': http_proxy, 'https': http_proxy }
|
7 |
|
|
|
38 |
|
39 |
gr.Interface(
|
40 |
fn=translate,
|
41 |
+
inputs=gr.Audio(source="microphone", type="numpy"), outputs="text").launch()
|
42 |
+
"""
|
43 |
+
def transcribe(audio):
|
44 |
+
text = p(audio)["text"]
|
45 |
+
return text
|
46 |
+
|
47 |
+
gr.Interface(
|
48 |
+
fn=transcribe,
|
49 |
+
inputs=gr.Audio(source="microphone", type="filepath"),
|
50 |
+
outputs="text").launch()
|