Update app.py
Browse files
app.py
CHANGED
|
@@ -122,12 +122,19 @@ def get_vits_array(input_text, flag):
|
|
| 122 |
audio = tts(input_text)
|
| 123 |
return "", (sampling_rate, audio)
|
| 124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
else:
|
| 126 |
raise Exception("Unknown flag : [" + flag + "]")
|
| 127 |
|
| 128 |
gradio_interface = gr.Interface(
|
| 129 |
fn = get_vits_array,
|
| 130 |
-
inputs = ["text", gr.Dropdown(["mokuran", "audio_array", "audio_file"], value="
|
| 131 |
outputs = ["text", "audio"]
|
| 132 |
)
|
| 133 |
|
|
|
|
| 122 |
audio = tts(input_text)
|
| 123 |
return "", (sampling_rate, audio)
|
| 124 |
|
| 125 |
+
# for tts api + gpt40 testing
|
| 126 |
+
elif flag == "gpt4o":
|
| 127 |
+
text = request_openai_message(input_text)
|
| 128 |
+
text = process_text(text)
|
| 129 |
+
audio = tts(text)
|
| 130 |
+
return text, (sampling_rate, audio)
|
| 131 |
+
|
| 132 |
else:
|
| 133 |
raise Exception("Unknown flag : [" + flag + "]")
|
| 134 |
|
| 135 |
gradio_interface = gr.Interface(
|
| 136 |
fn = get_vits_array,
|
| 137 |
+
inputs = ["text", gr.Dropdown(["mokuran", "audio_array", "audio_file", "gpt4o"], value="gpt4o")],
|
| 138 |
outputs = ["text", "audio"]
|
| 139 |
)
|
| 140 |
|