Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,8 @@ def chat_hf(audio, custom_token, language):
|
|
37 |
|
38 |
# to voice
|
39 |
if language == 'cn' or 'jp':
|
40 |
-
text =
|
|
|
41 |
audio = infer.infer(text, net_g_ms, 0, "demo")
|
42 |
voice_out = (hps.data.sampling_rate, audio)
|
43 |
else:
|
@@ -75,9 +76,8 @@ def openai_create(prompt):
|
|
75 |
presence_penalty=0.6,
|
76 |
stop=[" Human:", " AI:"]
|
77 |
)
|
78 |
-
|
79 |
-
|
80 |
-
return text_out
|
81 |
|
82 |
|
83 |
with gr.Blocks() as blocks:
|
|
|
37 |
|
38 |
# to voice
|
39 |
if language == 'cn' or 'jp':
|
40 |
+
text = gpt_response.strip().replace(' ', '').replace('\n', '').replace('\r', '')
|
41 |
+
text = infer.clean_text(text)
|
42 |
audio = infer.infer(text, net_g_ms, 0, "demo")
|
43 |
voice_out = (hps.data.sampling_rate, audio)
|
44 |
else:
|
|
|
76 |
presence_penalty=0.6,
|
77 |
stop=[" Human:", " AI:"]
|
78 |
)
|
79 |
+
print(response.choices[0].text)
|
80 |
+
return response.choices[0].text
|
|
|
81 |
|
82 |
|
83 |
with gr.Blocks() as blocks:
|