Update app.py
Browse files
app.py
CHANGED
@@ -180,37 +180,40 @@ def clear_history():
|
|
180 |
return None, None, "Conversation history cleared."
|
181 |
|
182 |
with gr.Blocks(css="style.css") as demo:
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
|
|
|
|
|
|
214 |
|
215 |
input_audio.change(
|
216 |
fn=respond,
|
|
|
180 |
return None, None, "Conversation history cleared."
|
181 |
|
182 |
with gr.Blocks(css="style.css") as demo:
|
183 |
+
gr.Markdown("# <center><b>Optimus Prime: Voice Assistant with Translation</b></center>")
|
184 |
+
|
185 |
+
with gr.Row():
|
186 |
+
with gr.Column(scale=1):
|
187 |
+
select = gr.Dropdown([
|
188 |
+
'Llama 3 8B Service',
|
189 |
+
'Mixtral 8x7B',
|
190 |
+
'Llama 3 8B',
|
191 |
+
'Mistral 7B v0.3',
|
192 |
+
'Phi 3 mini',
|
193 |
+
],
|
194 |
+
value="Llama 3 8B Service",
|
195 |
+
label="Model"
|
196 |
+
)
|
197 |
+
seed = gr.Slider(
|
198 |
+
label="Seed",
|
199 |
+
minimum=0,
|
200 |
+
maximum=999999,
|
201 |
+
step=1,
|
202 |
+
value=0,
|
203 |
+
visible=False
|
204 |
+
)
|
205 |
+
target_lang = gr.Dropdown(
|
206 |
+
choices=list(LANGUAGE_CODES.keys()),
|
207 |
+
value="German",
|
208 |
+
label="Target Language for Translation"
|
209 |
+
)
|
210 |
+
input_audio = gr.Audio(label="User Input", sources=["microphone"], type="filepath")
|
211 |
+
clear_button = gr.Button("Clear Conversation History")
|
212 |
+
|
213 |
+
with gr.Column(scale=1):
|
214 |
+
output_audio = gr.Audio(label="AI Response", type="filepath", interactive=False, autoplay=True)
|
215 |
+
translated_audio = gr.Audio(label="Translated Audio", type="filepath", interactive=False, autoplay=True)
|
216 |
+
status_message = gr.Textbox(label="Status", interactive=False)
|
217 |
|
218 |
input_audio.change(
|
219 |
fn=respond,
|