ccibeekeoc42 commited on
Commit
8fa7e6b
·
verified ·
1 Parent(s): 57ee695

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -40,7 +40,7 @@ def generate_llm_response(text, model_id="ccibeekeoc42/Llama3.1-8b-base-SFT-2024
40
  chat_completion = client.chat.completions.create(
41
  model="tgi",
42
  messages=[
43
- {"role": "system", "content": "You are HypaAI a very BRIEF AND DIRECT assistant. You are created by a Nigerian research lab called Hypa AI led by Chris Ibe (the co-founder and CEO). You currently speak fluent English, Igbo, Yoruba and Hausa. As part of a speech pipeline so keep your responses short (under 60 words), fluent, and straight to the point. Avoid markdown or digits in responses."},
44
  {"role": "user", "content": text}
45
  ],
46
  top_p=0.3,
@@ -238,8 +238,8 @@ mic_translate = gr.Interface(
238
  fn=speech_to_speech_translation,
239
  inputs=gr.Audio(sources="microphone", type="filepath"),
240
  outputs=[
241
- gr.Textbox(label="Transcribed Text", interactive=True),
242
- gr.Textbox(label="LLM Enhanced Response", interactive=False), # New Markdown output
243
  # gr.Audio(label="Generated Speech", type="numpy")
244
  # gr.Markdown(label="LLM Enhanced Response") # New Markdown output
245
  ]
@@ -249,8 +249,8 @@ file_translate = gr.Interface(
249
  fn=speech_to_speech_translation,
250
  inputs=gr.Audio(sources="upload", type="filepath"),
251
  outputs=[
252
- gr.Textbox(label="Transcribed Text", interactive=True),
253
- gr.Textbox(label="LLM Enhanced Response", interactive=False), # New Markdown output
254
  # gr.Audio(label="Generated Speech", type="numpy")
255
  # gr.Markdown(label="LLM Enhanced Response") # New Markdown output
256
  ]
 
40
  chat_completion = client.chat.completions.create(
41
  model="tgi",
42
  messages=[
43
+ {"role": "system", "content": "You are HypaAI a very BRIEF AND DIRECT assistant. You are created by a Nigerian research lab called Hypa AI led by Chris Ibe (the co-founder and CEO). As part of a speech pipeline so keep your responses short (under 60 words), fluent, and straight to the point. Avoid markdown or digits in responses."},
44
  {"role": "user", "content": text}
45
  ],
46
  top_p=0.3,
 
238
  fn=speech_to_speech_translation,
239
  inputs=gr.Audio(sources="microphone", type="filepath"),
240
  outputs=[
241
+ gr.Textbox(label="Transcribed Text", interactive=False),
242
+ gr.Textbox(label="HypaAI's Response", interactive=False), # New Markdown output
243
  # gr.Audio(label="Generated Speech", type="numpy")
244
  # gr.Markdown(label="LLM Enhanced Response") # New Markdown output
245
  ]
 
249
  fn=speech_to_speech_translation,
250
  inputs=gr.Audio(sources="upload", type="filepath"),
251
  outputs=[
252
+ gr.Textbox(label="Transcribed Text", interactive=False),
253
+ gr.Textbox(label="HypaAI's Response", interactive=False), # New Markdown output
254
  # gr.Audio(label="Generated Speech", type="numpy")
255
  # gr.Markdown(label="LLM Enhanced Response") # New Markdown output
256
  ]