mohcineelharras commited on
Commit
f5fc0a3
Β·
1 Parent(s): de072d8

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -172,13 +172,19 @@ def update_tts_method(method):
172
  global tts_method
173
  tts_method = method
174
 
 
 
 
 
 
175
  #----------------------------------- Gradio Frontend-----------------------------------
176
 
177
  # Gradio Interface
178
- with gr.Blocks() as app:
179
- gr.Markdown("## πŸ€– whisper - LLM - TTS πŸ“š")
180
- gr.Markdown("πŸš€ Talk to an open source LLM!")
181
- gr.Markdown("This app is developed and maintained by **@mohcineelharras**")
 
182
 
183
  with gr.Row():
184
  with gr.Column():
@@ -187,6 +193,10 @@ with gr.Blocks() as app:
187
  with gr.Column():
188
  tts_method_switch = gr.Radio(choices=["gTTS", "Custom TTS"], label="Select TTS method", value=tts_method)
189
  tts_method_switch.change(update_tts_method, inputs=[tts_method_switch])
 
 
 
 
190
  # with gr.Column():
191
  # sample_voice = gr.Audio(label="Voice Sample to customise assistant's response",sources="microphone")
192
  # customise_voice = gr.Button("Change assistant's voice")
 
172
  global tts_method
173
  tts_method = method
174
 
175
+ # Clear button
176
+ def clear_memory():
177
+ global memory
178
+ memory = ""
179
+
180
  #----------------------------------- Gradio Frontend-----------------------------------
181
 
182
  # Gradio Interface
183
+ #theme="dark"
184
+ with gr.Blocks(title="Whisper-LLM-TTS") as app:
185
+ gr.Markdown("## πŸ€– 'Whispering' LLM with a TTS Twist! πŸ“š")
186
+ gr.Markdown("πŸš€ Engage in a not-so-secret chat with an open-source LLM that whispers back!")
187
+ gr.Markdown("πŸ‘¨β€πŸ’» Crafted with a sprinkle of code magic (and a few cups of coffee) by **@mohcineelharras** β€” not your average tech wizard!")
188
 
189
  with gr.Row():
190
  with gr.Column():
 
193
  with gr.Column():
194
  tts_method_switch = gr.Radio(choices=["gTTS", "Custom TTS"], label="Select TTS method", value=tts_method)
195
  tts_method_switch.change(update_tts_method, inputs=[tts_method_switch])
196
+ with gr.Row():
197
+ clear_memory_button = gr.Button("Clear Memory")
198
+ clear_memory_button.click(clear_memory, inputs=[], outputs=[])
199
+
200
  # with gr.Column():
201
  # sample_voice = gr.Audio(label="Voice Sample to customise assistant's response",sources="microphone")
202
  # customise_voice = gr.Button("Change assistant's voice")