Spaces:
Build error
Build error
Update app.py
Browse files
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 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
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=
|
245 |
-
texts = gr.Textbox(lines=
|
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])
|