Spaces:
Runtime error
Runtime error
MSchell0129
commited on
Commit
·
99caa7a
1
Parent(s):
83fbf25
12
Browse files- Dockerfile +1 -1
- speech_to_text.py +11 -1
Dockerfile
CHANGED
@@ -3,4 +3,4 @@ WORKDIR /code
|
|
3 |
COPY ./requirements.txt /code/requirements.txt
|
4 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
5 |
COPY . .
|
6 |
-
CMD ["uvicorn","
|
|
|
3 |
COPY ./requirements.txt /code/requirements.txt
|
4 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
5 |
COPY . .
|
6 |
+
CMD ["uvicorn","speech_to_text:app", "--host", "0.0.0.0", "--port", "7860"]
|
speech_to_text.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import openai
|
2 |
import whisper
|
|
|
3 |
import os
|
4 |
|
5 |
|
@@ -27,5 +28,14 @@ def transcribe(aud_inp, whisper_lang):
|
|
27 |
print(result.text)
|
28 |
return result
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
if __name__ == '__main__':
|
31 |
-
|
|
|
1 |
import openai
|
2 |
import whisper
|
3 |
+
import gradio as gr
|
4 |
import os
|
5 |
|
6 |
|
|
|
28 |
print(result.text)
|
29 |
return result
|
30 |
|
31 |
+
block = gr.Blocks()
|
32 |
+
|
33 |
+
def run():
|
34 |
+
with block:
|
35 |
+
gr.Interface(fn=transcribe, inputs="microphone", outputs="text")
|
36 |
+
block.launch(server_name='0.0.0.0', server_port=7860)
|
37 |
+
if __name__ == '__main__':
|
38 |
+
run()
|
39 |
+
|
40 |
if __name__ == '__main__':
|
41 |
+
run()
|