Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -67,12 +67,15 @@ def save_and_play_audio(audio_recorder):
|
|
67 |
return filename
|
68 |
return None
|
69 |
|
|
|
70 |
filename = save_and_play_audio(audio_recorder)
|
71 |
if filename is not None:
|
72 |
-
if st.button("Transcribe"):
|
73 |
-
|
74 |
-
|
75 |
-
|
|
|
|
|
76 |
|
77 |
def create_file(filename, prompt, response):
|
78 |
if filename.endswith(".txt"):
|
|
|
67 |
return filename
|
68 |
return None
|
69 |
|
70 |
+
# Updated to call direct from transcription to chat inference.
|
71 |
filename = save_and_play_audio(audio_recorder)
|
72 |
if filename is not None:
|
73 |
+
#if st.button("Transcribe"):
|
74 |
+
transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
|
75 |
+
st.markdown('### Transcription:')
|
76 |
+
st.write(transcription)
|
77 |
+
#chat_with_model(transcription, '') # push transcript through as prompt
|
78 |
+
response2 = chat_with_model(transcription.json().get('text'), '')
|
79 |
|
80 |
def create_file(filename, prompt, response):
|
81 |
if filename.endswith(".txt"):
|