Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,6 +173,9 @@ def get_answer_ai(text):
|
|
| 173 |
AI=create_chat_session()
|
| 174 |
response = AI.send_message(text)
|
| 175 |
return response.text
|
|
|
|
|
|
|
|
|
|
| 176 |
import gradio as gr
|
| 177 |
import os
|
| 178 |
import plotly.express as px
|
|
@@ -320,7 +323,13 @@ with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
|
| 320 |
# Update the event binding
|
| 321 |
generate_button.click(generate_audio, inputs=[text_input,model_choices2], outputs=audio_player)
|
| 322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
|
|
|
|
| 324 |
|
| 325 |
|
| 326 |
if __name__ == "__main__":
|
|
|
|
| 173 |
AI=create_chat_session()
|
| 174 |
response = AI.send_message(text)
|
| 175 |
return response.text
|
| 176 |
+
|
| 177 |
+
def t2t(text):
|
| 178 |
+
return get_answer_ai(text)
|
| 179 |
import gradio as gr
|
| 180 |
import os
|
| 181 |
import plotly.express as px
|
|
|
|
| 323 |
# Update the event binding
|
| 324 |
generate_button.click(generate_audio, inputs=[text_input,model_choices2], outputs=audio_player)
|
| 325 |
|
| 326 |
+
with gr.Tab("T2T "):
|
| 327 |
+
gr.Markdown("## T2T")
|
| 328 |
+
text_inputk = gr.Textbox(label="أدخل النص هنا")
|
| 329 |
+
text_out = gr.Textbox()
|
| 330 |
+
text_inputk.submit(t2t, [text_inputk], [text_out])
|
| 331 |
|
| 332 |
+
|
| 333 |
|
| 334 |
|
| 335 |
if __name__ == "__main__":
|