Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -125,7 +125,7 @@ async def respond(audio):
|
|
125 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
126 |
tmp_path = tmp_file.name
|
127 |
await communicate.save(tmp_path)
|
128 |
-
yield tmp_path
|
129 |
|
130 |
async def generate1(TextPrompt):
|
131 |
TextOut = respondtxt(TextPrompt)
|
@@ -145,15 +145,16 @@ with gr.Blocks(theme=gr.themes.Glass(font=[gr.themes.GoogleFont("Inconsolata"),
|
|
145 |
|
146 |
with gr.Tab("Talk to Sonia"):
|
147 |
with gr.Group():
|
148 |
-
us_input = gr.Audio(label="Your Voice Chat", type="filepath", interactive=True, sources="microphone", waveform_options=gr.WaveformOptions(show_recording_waveform=False), container=True
|
149 |
-
|
150 |
-
gr.
|
|
|
151 |
|
152 |
with gr.Tab("Write to Sonia"):
|
153 |
with gr.Group():
|
154 |
user_input = gr.TextArea(label="Your Question", show_copy_button=True, 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.")
|
155 |
-
output_text = gr.TextArea(label="Sonia's Response", interactive=False, show_copy_button=True, value="", container=True
|
156 |
-
output_audio = gr.Audio(label="Sonia's Response", type="filepath", interactive=False, autoplay=True, elem_classes="audio",
|
157 |
gr.Interface(fn=generate1, inputs=user_input, outputs=[output_text, output_audio], live=False)
|
158 |
|
159 |
|
|
|
125 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
126 |
tmp_path = tmp_file.name
|
127 |
await communicate.save(tmp_path)
|
128 |
+
yield reply, tmp_path
|
129 |
|
130 |
async def generate1(TextPrompt):
|
131 |
TextOut = respondtxt(TextPrompt)
|
|
|
145 |
|
146 |
with gr.Tab("Talk to Sonia"):
|
147 |
with gr.Group():
|
148 |
+
us_input = gr.Audio(label="Your Voice Chat", type="filepath", interactive=True, sources="microphone", waveform_options=gr.WaveformOptions(show_recording_waveform=False), container=True)
|
149 |
+
us_text = gr.TextArea(label="Sonia's Text Response", interactive=False, show_copy_button=True, value="", container=True)
|
150 |
+
us_output = gr.Audio(label="Sonia's Response", type="filepath", interactive=False, autoplay=True, elem_classes="audio", waveform_options=gr.WaveformOptions(show_recording_waveform=False), container=True)
|
151 |
+
gr.Interface(fn=respond, inputs=us_input, outputs=[us_text, us_output], live=False)
|
152 |
|
153 |
with gr.Tab("Write to Sonia"):
|
154 |
with gr.Group():
|
155 |
user_input = gr.TextArea(label="Your Question", show_copy_button=True, 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.")
|
156 |
+
output_text = gr.TextArea(label="Sonia's Text Response", interactive=False, show_copy_button=True, value="", container=True)
|
157 |
+
output_audio = gr.Audio(label="Sonia's Audio Response", type="filepath", interactive=False, autoplay=True, elem_classes="audio", waveform_options=gr.WaveformOptions(show_recording_waveform=False), container=True)
|
158 |
gr.Interface(fn=generate1, inputs=user_input, outputs=[output_text, output_audio], live=False)
|
159 |
|
160 |
|