Jaward commited on
Commit
e0a46f2
·
verified ·
1 Parent(s): ddb6345

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -31
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
- description = gr.Markdown("# <center><b>Optimus Prime: Voice Assistant with Translation</b></center>")
184
-
185
- select = gr.Dropdown([
186
- 'Llama 3 8B Service',
187
- 'Mixtral 8x7B',
188
- 'Llama 3 8B',
189
- 'Mistral 7B v0.3',
190
- 'Phi 3 mini',
191
- ],
192
- value="Llama 3 8B Service",
193
- label="Model"
194
- )
195
- seed = gr.Slider(
196
- label="Seed",
197
- minimum=0,
198
- maximum=999999,
199
- step=1,
200
- value=0,
201
- visible=False
202
- )
203
- target_lang = gr.Dropdown(
204
- choices=list(LANGUAGE_CODES.keys()),
205
- value="German",
206
- label="Target Language for Translation"
207
- )
208
- input_audio = gr.Audio(label="User Input", sources=["microphone"], type="filepath")
209
- output_audio = gr.Audio(label="AI Response", type="filepath", interactive=False, autoplay=True)
210
- translated_audio = gr.Audio(label="Translated Audio", type="filepath", interactive=False, autoplay=True)
211
- status_message = gr.Textbox(label="Status", interactive=False)
212
-
213
- clear_button = gr.Button("Clear Conversation History")
 
 
 
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,