Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def generate_prompt(instruction, input=None):
|
|
41 |
def evaluate(
|
42 |
# instruction,
|
43 |
audio,
|
44 |
-
|
45 |
input=None,
|
46 |
token_count=200,
|
47 |
temperature=1.0,
|
@@ -109,9 +109,9 @@ def evaluate(
|
|
109 |
|
110 |
# res1 = ' '.join(str(x) for x in res)
|
111 |
|
112 |
-
|
113 |
|
114 |
-
return res
|
115 |
|
116 |
# return [result.text, res]
|
117 |
|
@@ -122,7 +122,7 @@ g = gr.Interface(
|
|
122 |
inputs=[
|
123 |
# gr.components.Textbox(lines=2, label="Instruction", value="Tell me about ravens."),
|
124 |
gr.Audio(source="microphone", label = "请开始对话吧!", type="filepath"),
|
125 |
-
|
126 |
gr.components.Textbox(lines=2, label="Input", placeholder="none"),
|
127 |
gr.components.Slider(minimum=10, maximum=200, step=10, value=150), # token_count
|
128 |
gr.components.Slider(minimum=0.2, maximum=2.0, step=0.1, value=1.0), # temperature
|
|
|
41 |
def evaluate(
|
42 |
# instruction,
|
43 |
audio,
|
44 |
+
upload,
|
45 |
input=None,
|
46 |
token_count=200,
|
47 |
temperature=1.0,
|
|
|
109 |
|
110 |
# res1 = ' '.join(str(x) for x in res)
|
111 |
|
112 |
+
tts.tts_to_file(res1, speaker_wav = upload, language="en", file_path="output.wav")
|
113 |
|
114 |
+
return [res, "output.wav"]
|
115 |
|
116 |
# return [result.text, res]
|
117 |
|
|
|
122 |
inputs=[
|
123 |
# gr.components.Textbox(lines=2, label="Instruction", value="Tell me about ravens."),
|
124 |
gr.Audio(source="microphone", label = "请开始对话吧!", type="filepath"),
|
125 |
+
gr.Audio(source="upload", label = "请上传您喜欢的声音(wav文件)", type="filepath"),
|
126 |
gr.components.Textbox(lines=2, label="Input", placeholder="none"),
|
127 |
gr.components.Slider(minimum=10, maximum=200, step=10, value=150), # token_count
|
128 |
gr.components.Slider(minimum=0.2, maximum=2.0, step=0.1, value=1.0), # temperature
|