Yusin commited on
Commit
82346b0
1 Parent(s): 912ece2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 = infer.clean_text(gpt_response)
 
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
- text_out = response.choices[0].text.strip().replace(' ', '').replace('\n', '').replace('\r', '')
79
- print(text_out)
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: