s1ri1337 commited on
Commit
ad0b7d3
1 Parent(s): c44e070

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,5 +1,9 @@
1
  import speech_recognition as sr
2
  from googletrans import Translator
 
 
 
 
3
 
4
  def transcribeHindi():
5
 
@@ -27,11 +31,11 @@ def transcribeHindi():
27
  return Query
28
 
29
  def translate():
 
30
  translator = Translator()
31
  translation = translator.translate(query, dest='en')
32
  return translation.text
33
 
34
  gr.Interface(
35
- fn=transcribeHindi,
36
- inputs=gr.Audio(source="microphone", type="filepath"),
37
- 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
 
8
  def transcribeHindi():
9
 
 
31
  return Query
32
 
33
  def translate():
34
+ query = transcribeHindi()
35
  translator = Translator()
36
  translation = translator.translate(query, dest='en')
37
  return translation.text
38
 
39
  gr.Interface(
40
+ fn=translate,
41
+ inputs=gr.Audio(source="microphone", type="numpy"), outputs="text").launch()