Spaces:
Runtime error
Runtime error
ASG Models
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,6 +43,10 @@ with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
|
| 43 |
with gr.Column():
|
| 44 |
text_input = gr.Textbox(label="أدخل أي نص")
|
| 45 |
user_audio = gr.Audio(label="صوتك")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
with gr.Column():
|
| 47 |
model_choices = gr.Dropdown(
|
| 48 |
choices=[
|
|
@@ -58,7 +62,7 @@ with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
|
| 58 |
ai_audio = gr.Audio(label="رد الذكاء الاصطناعي الصوتي")
|
| 59 |
ai_text = gr.Textbox(label="رد الذكاء الاصطناعي النصي")
|
| 60 |
|
| 61 |
-
|
| 62 |
|
| 63 |
# Use a single button to trigger both functionalities
|
| 64 |
def process_audio(text, model_choice, generate_user_audio=True):
|
|
@@ -79,9 +83,8 @@ with gr.Blocks() as demo: # Use gr.Blocks to wrap the entire interface
|
|
| 79 |
)
|
| 80 |
|
| 81 |
# Additional button to generate only AI audio
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
btn_ai_only.click(
|
| 85 |
lambda text, model_choice: process_audio(text, model_choice, False),
|
| 86 |
inputs=[text_input, model_choices],
|
| 87 |
outputs=[ai_audio],
|
|
|
|
| 43 |
with gr.Column():
|
| 44 |
text_input = gr.Textbox(label="أدخل أي نص")
|
| 45 |
user_audio = gr.Audio(label="صوتك")
|
| 46 |
+
with gr.Row():
|
| 47 |
+
btn = gr.Button("إرسال")
|
| 48 |
+
btn_ai_only = gr.Button("توليد رد الذكاء الاصطناعي فقط")
|
| 49 |
+
|
| 50 |
with gr.Column():
|
| 51 |
model_choices = gr.Dropdown(
|
| 52 |
choices=[
|
|
|
|
| 62 |
ai_audio = gr.Audio(label="رد الذكاء الاصطناعي الصوتي")
|
| 63 |
ai_text = gr.Textbox(label="رد الذكاء الاصطناعي النصي")
|
| 64 |
|
| 65 |
+
|
| 66 |
|
| 67 |
# Use a single button to trigger both functionalities
|
| 68 |
def process_audio(text, model_choice, generate_user_audio=True):
|
|
|
|
| 83 |
)
|
| 84 |
|
| 85 |
# Additional button to generate only AI audio
|
| 86 |
+
|
| 87 |
+
btn_ai_only.click(
|
|
|
|
| 88 |
lambda text, model_choice: process_audio(text, model_choice, False),
|
| 89 |
inputs=[text_input, model_choices],
|
| 90 |
outputs=[ai_audio],
|