Spaces:
Paused
Paused
Commit
·
7132773
1
Parent(s):
7a0493d
refactor complete
Browse files- .gitignore +1 -0
- app.py +3 -5
.gitignore
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
TARS-ENV/
|
2 |
local_config.py
|
|
|
3 |
|
4 |
# Byte-compiled / optimized / DLL files
|
5 |
__pycache__/
|
|
|
1 |
TARS-ENV/
|
2 |
local_config.py
|
3 |
+
*.wav
|
4 |
|
5 |
# Byte-compiled / optimized / DLL files
|
6 |
__pycache__/
|
app.py
CHANGED
@@ -29,15 +29,13 @@ def gen_voice(response, response_filename):
|
|
29 |
stream.save_to_wav_file(response_filename)
|
30 |
|
31 |
def conversation(audio:str):
|
32 |
-
|
33 |
-
transcript = transcribe("whisper-1", audio_file)
|
34 |
context.append({"role": "user", "content": transcript['text']})
|
35 |
|
36 |
response = gen_response("gpt-3.5-turbo", context)
|
37 |
-
|
38 |
-
context.append(system_message)
|
39 |
|
40 |
-
gen_voice(
|
41 |
|
42 |
chat_transcript = ""
|
43 |
for message in context:
|
|
|
29 |
stream.save_to_wav_file(response_filename)
|
30 |
|
31 |
def conversation(audio:str):
|
32 |
+
transcript = transcribe("whisper-1", audio)
|
|
|
33 |
context.append({"role": "user", "content": transcript['text']})
|
34 |
|
35 |
response = gen_response("gpt-3.5-turbo", context)
|
36 |
+
context.append(response)
|
|
|
37 |
|
38 |
+
gen_voice(response, "voice.wav")
|
39 |
|
40 |
chat_transcript = ""
|
41 |
for message in context:
|