VanYsa commited on
Commit
9279bb0
Β·
1 Parent(s): afd80fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -18,8 +18,9 @@ SAMPLE_RATE = 16000 # Hz
18
  MAX_AUDIO_MINUTES = 10 # wont try to transcribe if longer than this
19
  DESCRIPTION = '''
20
  <div>
21
- <h1 style="text-align: center;">Meta Llama3 8B</h1>
22
- <p>This Space demonstrates the instruction-tuned model <a href="https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct"><b>Meta Llama3 8b Chat</b></a>. Meta Llama3 is the new open LLM and comes in two sizes: 8b and 70b. Feel free to play with it, or duplicate to run privately!</p>
 
23
  <p>πŸ”Ž For more details about the Llama3 release and how to use the model with <code>transformers</code>, take a look <a href="https://huggingface.co/blog/llama3">at our blog post</a>.</p>
24
  <p>πŸ¦• Looking for an even more powerful model? Check out the <a href="https://huggingface.co/chat/"><b>Hugging Chat</b></a> integration for Meta Llama 3 70b</p>
25
  </div>
@@ -27,8 +28,7 @@ DESCRIPTION = '''
27
  PLACEHOLDER = """
28
  <div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
29
  <img src="MyAlexaLogo.png" style="width: 80%; max-width: 550px; height: auto; opacity: 0.55; ">
30
- <h1 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;">MyAlexa 0.1.0</h1>
31
- <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">What's on your mind?</p>
32
  </div>
33
  """
34
 
@@ -150,7 +150,7 @@ with gr.Blocks(
150
  title="NeMo Canary Model",
151
  css="""
152
  textarea { font-size: 18px;}
153
- #model_output_text_box span {
154
  font-size: 18px;
155
  font-weight: bold;
156
  }
@@ -158,14 +158,13 @@ with gr.Blocks(
158
  theme=gr.themes.Default(text_size=gr.themes.sizes.text_lg) # make text slightly bigger (default is text_md )
159
  ) as demo:
160
 
161
- gr.HTML("<h1 style='text-align: center'>NeMo Canary model: Transcribe & Translate audio</h1>")
162
  gr.HTML(DESCRIPTION)
163
  chatbot = gr.Chatbot(
164
  [],
165
  elem_id="chatbot",
166
  bubble_full_width=False,
167
  placeholder=PLACEHOLDER,
168
- label='MyAlexa 0.1.0'
169
  )
170
  with gr.Row():
171
  with gr.Column():
@@ -187,11 +186,11 @@ with gr.Blocks(
187
 
188
  chat_input = gr.Textbox(
189
  label="Transcribed text:",
190
- elem_id="model_output_text_box",
191
  )
192
- chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
193
- bot_msg = chat_msg.then(bot, chatbot, chatbot, api_name="bot_response")
194
- bot_msg.then(lambda: gr.Textbox(interactive=True), None, [chat_input])
195
 
196
  go_button.click(
197
  fn=transcribe,
 
18
  MAX_AUDIO_MINUTES = 10 # wont try to transcribe if longer than this
19
  DESCRIPTION = '''
20
  <div>
21
+ <h1 style='text-align: center'>MyAlexa: Voice Chat Assistant</h1>
22
+ <p style='text-align: center'>This is a demo of a voice chat that accepts an audio input up to 10 minutes long. Translation and text are limited to the English language.</p>
23
+ <p>This Space uses nvidia's canaray 1b model to transcribe input audio, LLama3 for LLM and VITS for TTS <a href="https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct"><b>Meta Llama3 8b Chat</b></a>. Meta Llama3 is the new open LLM and comes in two sizes: 8b and 70b. Feel free to play with it, or duplicate to run privately!</p>
24
  <p>πŸ”Ž For more details about the Llama3 release and how to use the model with <code>transformers</code>, take a look <a href="https://huggingface.co/blog/llama3">at our blog post</a>.</p>
25
  <p>πŸ¦• Looking for an even more powerful model? Check out the <a href="https://huggingface.co/chat/"><b>Hugging Chat</b></a> integration for Meta Llama 3 70b</p>
26
  </div>
 
28
  PLACEHOLDER = """
29
  <div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
30
  <img src="MyAlexaLogo.png" style="width: 80%; max-width: 550px; height: auto; opacity: 0.55; ">
31
+ <p style="font-size: 28px; margin-bottom: 2px; opacity: 0.65;">What's on your mind?</p>
 
32
  </div>
33
  """
34
 
 
150
  title="NeMo Canary Model",
151
  css="""
152
  textarea { font-size: 18px;}
153
+ #chat_input span {
154
  font-size: 18px;
155
  font-weight: bold;
156
  }
 
158
  theme=gr.themes.Default(text_size=gr.themes.sizes.text_lg) # make text slightly bigger (default is text_md )
159
  ) as demo:
160
 
 
161
  gr.HTML(DESCRIPTION)
162
  chatbot = gr.Chatbot(
163
  [],
164
  elem_id="chatbot",
165
  bubble_full_width=False,
166
  placeholder=PLACEHOLDER,
167
+ label='MyAlexa'
168
  )
169
  with gr.Row():
170
  with gr.Column():
 
186
 
187
  chat_input = gr.Textbox(
188
  label="Transcribed text:",
189
+ elem_id="chat_input",
190
  )
191
+ # chat_msg = chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])
192
+ # bot_msg = chat_msg.then(bot, chatbot, chatbot, api_name="bot_response")
193
+ # bot_msg.then(lambda: gr.Textbox(interactive=True), None, [chat_input])
194
 
195
  go_button.click(
196
  fn=transcribe,