Spaces:
Runtime error
Runtime error
MSchell0129
commited on
Commit
·
624e848
1
Parent(s):
1a001e3
created app file
Browse files- Dockerfile +1 -1
- app.py +10 -0
- speech_to_text.py +1 -1
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
WORKDIR /speech_to_text
|
| 3 |
COPY ./requirements.txt /speech_to_text/requirements.txt
|
| 4 |
RUN pip install --no-cache-dir --upgrade -r /speech_to_text/requirements.txt
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
WORKDIR /speech_to_text
|
| 3 |
COPY ./requirements.txt /speech_to_text/requirements.txt
|
| 4 |
RUN pip install --no-cache-dir --upgrade -r /speech_to_text/requirements.txt
|
app.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from speech_to_text import transcribe
|
| 3 |
+
block = gr.Blocks()
|
| 4 |
+
|
| 5 |
+
def run():
|
| 6 |
+
with block:
|
| 7 |
+
gr.Interface(fn=transcribe, inputs="microphone", outputs="text")
|
| 8 |
+
block.launch(server_name='0.0.0.0', server_port=7860)
|
| 9 |
+
if __name__ == '__main__':
|
| 10 |
+
run()
|
speech_to_text.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import openai
|
| 2 |
import whisper
|
| 3 |
-
|
| 4 |
from api_key import open_ai_key
|
| 5 |
|
| 6 |
llm = openai(temperature=0, openai_api_key='open_ai_key')
|
|
|
|
| 1 |
import openai
|
| 2 |
import whisper
|
| 3 |
+
|
| 4 |
from api_key import open_ai_key
|
| 5 |
|
| 6 |
llm = openai(temperature=0, openai_api_key='open_ai_key')
|