Kevin676 commited on
Commit
2b9a061
·
1 Parent(s): 887d5dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -172,10 +172,10 @@ def chatgpt(apikey, audio):
172
  return [result.text, chat_response, "output.wav"]
173
 
174
  def compute_spec(ref_file):
175
- y, sr = librosa.load(ref_file, sr=ap.sample_rate)
176
- spec = ap.spectrogram(y)
177
- spec = torch.FloatTensor(spec).unsqueeze(0)
178
- return spec
179
 
180
 
181
  def voice_conversion(ta, ra, da):
@@ -241,8 +241,8 @@ with block:
241
 
242
  btn = gr.Button("开始对话吧")
243
 
244
- yousay = gr.Textbox(lines=3, label="您的提问")
245
- texts = gr.Textbox(lines=5, label="ChatGPT的回答")
246
  audio_tts = gr.Audio(label="自动合成的声音")
247
 
248
  btn.click(chatgpt, [inp1, inp2], [yousay, texts, audio_tts])
 
172
  return [result.text, chat_response, "output.wav"]
173
 
174
  def compute_spec(ref_file):
175
+ y, sr = librosa.load(ref_file, sr=ap.sample_rate)
176
+ spec = ap.spectrogram(y)
177
+ spec = torch.FloatTensor(spec).unsqueeze(0)
178
+ return spec
179
 
180
 
181
  def voice_conversion(ta, ra, da):
 
241
 
242
  btn = gr.Button("开始对话吧")
243
 
244
+ yousay = gr.Textbox(lines=1, label="您的提问")
245
+ texts = gr.Textbox(lines=2, label="ChatGPT的回答")
246
  audio_tts = gr.Audio(label="自动合成的声音")
247
 
248
  btn.click(chatgpt, [inp1, inp2], [yousay, texts, audio_tts])