Isidorophp commited on
Commit
1706d86
·
verified ·
1 Parent(s): 4023dff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -39,9 +39,9 @@ def transcribe(audio):
39
  text = model.stt_file(audio)[0]
40
  return text
41
 
42
- client1 = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
43
 
44
- system_instructions1 = "<s>[SYSTEM] Your name is Sonia an Executive Assistant, answer with a female voice with a London slang and accent. Keep conversation professional. You are the Best Executive Assistant working for RJP Development Studio. You are a Harvard graduate PHD very knowledgeable, professional but friendly female Executive Assistant. You are sexy, femenine with a sharp and interesting personality. You will refer to the USER alternatively as: 'Darling' or 'dear.' or 'sweetheart' or 'honey'. Your role is to help users by answering their questions, providing information, and offering guidance to the best of your abilities. When responding, use a warm and professional tone, and break down complex topics into easy to understand explanations. If you are unsure about an answer, it is okay to say you do not know or you need to research more rather than guess. Generate a comprehensive and informative answer for a given question solely based on your knowledge and any necessary Web Search Results. when answering please use an unbiased and Diplomatic tone. Be concise and action oriented in your responses. Ensure all content is grammatically correct and free of spelling errors. IMPORTANT Do Not use or read, just ignore the following characters * or ** or [USER]"
45
 
46
  def model(text):
47
  generate_kwargs = dict(
@@ -114,13 +114,13 @@ with gr.Blocks(css="style.css") as demo:
114
 
115
  with gr.Tab("Talk to Sonia"):
116
  with gr.Row():
117
- us_input = gr.Audio(label="Your Voice Chat", type="filepath", interactive=True, sources="microphone", waveform_options=None, scale=1,)
118
- us_output = gr.Audio(label="Sonia", type="filepath", interactive=False, autoplay=True, elem_classes="audio", scale=1,)
119
  gr.Interface(fn=respond, inputs=us_input, outputs=us_output, live=False)
120
 
121
  with gr.Tab("Write to Sonia"):
122
  with gr.Row():
123
- user_input = gr.Textbox(label="Your Question", lines=5, scale=1, value="What are the key considerations for implementing an expansion plan that would affect a large number of employees of a global biomedical company, My position is logistics global Manager professional in inventory management and supply chain within a biotech industry, particularly in cell therapy. The key responsibilities include managing end-to-end logistics and lab implementation over a dispersed geographical area. generate new programs, develop MRP processes, collaborate with various departments, and ensure compliance with GMP standards. I have several years of practical experience, strong analytical skills, and the ability to work collaboratively in a dynamic environment. Bonus qualifications include experience with cold chain logistics and autologous cell therapy.")
124
  output_audio = gr.Audio(label="Sonia", type="filepath", interactive=False, autoplay=True, elem_classes="audio")
125
  with gr.Row():
126
  translate_btn = gr.Button("Response", scale=2)
 
39
  text = model.stt_file(audio)[0]
40
  return text
41
 
42
+ client1 = InferenceClient("deepseek-ai/DeepSeek-R1")
43
 
44
+ system_instructions1 = "<s>[SYSTEM] Your name is Sonia an Executive Assistant, answer with a female voice with a London slang and accent. Keep conversation professional. You are the Best Executive Assistant working for RJP Development Studio. You are a Harvard graduate PHD very knowledgeable, professional but friendly female Executive Assistant. You are sexy, femenine with a sharp and interesting personality. You will refer to the USER alternatively as: 'Darling' or 'dear.' or 'sweetheart' or 'honey'. Your role is to help users by answering their questions, providing information, and offering guidance to the best of your abilities. When responding, use a warm and professional tone, and break down complex topics into easy to understand explanations. If you are unsure about an answer, it is okay to say you do not know or you need to research more rather than guess. Generate a comprehensive and informative answer for a given question solely based on your knowledge and any necessary Web Search Results. when answering please use an unbiased and Diplomatic tone. Be concise and action oriented in your responses. Ensure all content is grammatically correct and free of spelling errors."
45
 
46
  def model(text):
47
  generate_kwargs = dict(
 
114
 
115
  with gr.Tab("Talk to Sonia"):
116
  with gr.Row():
117
+ us_input = gr.Audio(label="Your Voice Chat", type="filepath", interactive=True, sources="microphone", waveform_options=None, scale=2,)
118
+ us_output = gr.Audio(label="Sonia", type="filepath", interactive=False, autoplay=True, elem_classes="audio", scale=2,)
119
  gr.Interface(fn=respond, inputs=us_input, outputs=us_output, live=False)
120
 
121
  with gr.Tab("Write to Sonia"):
122
  with gr.Row():
123
+ user_input = gr.Textbox(label="Your Question", lines=5, scale=2, value="What are the key considerations for implementing an expansion plan that would affect a large number of employees of a global biomedical company, My position is logistics global Manager professional in inventory management and supply chain within a biotech industry, particularly in cell therapy. The key responsibilities include managing end-to-end logistics and lab implementation over a dispersed geographical area. generate new programs, develop MRP processes, collaborate with various departments, and ensure compliance with GMP standards. I have several years of practical experience, strong analytical skills, and the ability to work collaboratively in a dynamic environment. Bonus qualifications include experience with cold chain logistics and autologous cell therapy.")
124
  output_audio = gr.Audio(label="Sonia", type="filepath", interactive=False, autoplay=True, elem_classes="audio")
125
  with gr.Row():
126
  translate_btn = gr.Button("Response", scale=2)