Update app.py
Browse files
app.py
CHANGED
@@ -97,50 +97,43 @@ demo = gr.Interface(
|
|
97 |
fn=translate_audio,
|
98 |
inputs=[
|
99 |
gr.Textbox(
|
100 |
-
label="
|
101 |
placeholder="Type text here or leave empty to use audio input...",
|
102 |
lines=2
|
103 |
),
|
104 |
gr.Audio(
|
105 |
type="filepath",
|
106 |
sources=["upload"],
|
107 |
-
label="
|
108 |
),
|
109 |
gr.Audio(
|
110 |
sources=["microphone"],
|
111 |
-
label="
|
112 |
type="filepath"
|
113 |
),
|
114 |
gr.Dropdown(
|
115 |
choices=list(languages.keys()),
|
116 |
value="tr",
|
117 |
-
label="
|
118 |
),
|
119 |
gr.Dropdown(
|
120 |
choices=list(languages.keys()),
|
121 |
value="en",
|
122 |
-
label="
|
123 |
)
|
124 |
],
|
125 |
outputs=[
|
126 |
-
gr.Audio(label="
|
127 |
-
gr.Textbox(label="
|
128 |
-
gr.Textbox(label="
|
129 |
-
gr.Textbox(label="
|
130 |
],
|
131 |
|
132 |
title="π€ VoiceAI61 - Universal Voice Translator",
|
133 |
description="π Upload an audio file OR record with microphone to translate between languages!",
|
134 |
article="""
|
135 |
<div style="text-align: center; margin-top: 20px;">
|
136 |
-
<
|
137 |
-
<p><strong>Option 1:</strong> π Upload an audio file (recommended)</p>
|
138 |
-
<p><strong>Option 2:</strong> π€ Record directly with microphone</p>
|
139 |
-
<p><strong>Option 3:</strong> π¬ Type text directly</p>
|
140 |
-
<p><strong>Then:</strong> Select source and target languages, wait for processing!</p>
|
141 |
-
<br>
|
142 |
-
<p>π§ <strong>Troubleshooting:</strong> If microphone doesn't work, use file upload instead.</p>
|
143 |
-
<p>π± <strong>Mobile users:</strong> File upload works better on mobile devices.</p>
|
144 |
</div>
|
145 |
""",
|
146 |
|
|
|
97 |
fn=translate_audio,
|
98 |
inputs=[
|
99 |
gr.Textbox(
|
100 |
+
label="Enter text to translate",
|
101 |
placeholder="Type text here or leave empty to use audio input...",
|
102 |
lines=2
|
103 |
),
|
104 |
gr.Audio(
|
105 |
type="filepath",
|
106 |
sources=["upload"],
|
107 |
+
label="Upload Audio File"
|
108 |
),
|
109 |
gr.Audio(
|
110 |
sources=["microphone"],
|
111 |
+
label="OR Record with Microphone",
|
112 |
type="filepath"
|
113 |
),
|
114 |
gr.Dropdown(
|
115 |
choices=list(languages.keys()),
|
116 |
value="tr",
|
117 |
+
label="Source Language"
|
118 |
),
|
119 |
gr.Dropdown(
|
120 |
choices=list(languages.keys()),
|
121 |
value="en",
|
122 |
+
label="Target Language"
|
123 |
)
|
124 |
],
|
125 |
outputs=[
|
126 |
+
gr.Audio(label="Translated Audio Output"),
|
127 |
+
gr.Textbox(label="Original Text"),
|
128 |
+
gr.Textbox(label="Translated Text"),
|
129 |
+
gr.Textbox(label="Audio Source Info")
|
130 |
],
|
131 |
|
132 |
title="π€ VoiceAI61 - Universal Voice Translator",
|
133 |
description="π Upload an audio file OR record with microphone to translate between languages!",
|
134 |
article="""
|
135 |
<div style="text-align: center; margin-top: 20px;">
|
136 |
+
<p>π± <strong>dear users:</strong> trabzon champion. </p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
</div>
|
138 |
""",
|
139 |
|