Spaces:
Paused
Paused
Commit
·
b2daea4
1
Parent(s):
afffced
deployments adjustments
Browse files- Makefile +3 -0
- app.py +4 -4
- requirements.txt +0 -1
Makefile
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
install:
|
2 |
+
pip install --upgrade pip &&\
|
3 |
+
pip install -r requirements.txt
|
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import openai
|
3 |
import config
|
4 |
-
import os
|
5 |
import azure.cognitiveservices.speech as speechsdk
|
6 |
|
7 |
openai.api_key = config.OPENAI_API_KEY
|
@@ -15,10 +15,10 @@ messages = [{"role": "system", "content": 'You are a clever and helpfull convers
|
|
15 |
def transcribe(audio: str):
|
16 |
global messages
|
17 |
|
18 |
-
audio_filename_with_extension = audio + '.wav'
|
19 |
-
os.rename(audio, audio_filename_with_extension)
|
20 |
|
21 |
-
audio_file = open(
|
22 |
transcript = openai.Audio.transcribe("whisper-1", audio_file)
|
23 |
|
24 |
messages.append({"role": "user", "content": transcript["text"]})
|
|
|
1 |
import gradio as gr
|
2 |
import openai
|
3 |
import config
|
4 |
+
#import os
|
5 |
import azure.cognitiveservices.speech as speechsdk
|
6 |
|
7 |
openai.api_key = config.OPENAI_API_KEY
|
|
|
15 |
def transcribe(audio: str):
|
16 |
global messages
|
17 |
|
18 |
+
#audio_filename_with_extension = audio + '.wav'
|
19 |
+
#os.rename(audio, audio_filename_with_extension)
|
20 |
|
21 |
+
audio_file = open(audio, "rb")
|
22 |
transcript = openai.Audio.transcribe("whisper-1", audio_file)
|
23 |
|
24 |
messages.append({"role": "user", "content": transcript["text"]})
|
requirements.txt
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
openai
|
2 |
gradio
|
3 |
-
os
|
4 |
azure-cognitiveservices-speech
|
|
|
1 |
openai
|
2 |
gradio
|
|
|
3 |
azure-cognitiveservices-speech
|