Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -127,13 +127,13 @@ async def respond(audio):
|
|
| 127 |
await communicate.save(tmp_path)
|
| 128 |
yield tmp_path
|
| 129 |
|
| 130 |
-
async def generate1(
|
| 131 |
voice = Female_language_dict.get("English (UK)-Sonia- (Female)", "default_voice")
|
| 132 |
communicate = edge_tts.Communicate(TextPrompt, voice)
|
| 133 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
| 134 |
tmp_path = tmp_file.name
|
| 135 |
await communicate.save(tmp_path)
|
| 136 |
-
yield tmp_path
|
| 137 |
|
| 138 |
|
| 139 |
with gr.Blocks(theme=gr.themes.Glass(font=[gr.themes.GoogleFont("Inconsolata"), "Arial", "Arial"])) as demo:
|
|
@@ -153,7 +153,7 @@ with gr.Blocks(theme=gr.themes.Glass(font=[gr.themes.GoogleFont("Inconsolata"),
|
|
| 153 |
user_input = gr.TextArea(label="Your Question", scale=1, 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.")
|
| 154 |
output_text = gr.TextArea(label="Sonia's Response", scale=1, interactive=False, show_copy_button=True, value=respondtxt(user_input.value), container=True )
|
| 155 |
output_audio = gr.Audio(label="Sonia's Response", scale=3, type="filepath", interactive=False, autoplay=True, elem_classes="audio", show_download_button= True, show_share_button = True, waveform_options=gr.WaveformOptions(show_recording_waveform=False), container=True )
|
| 156 |
-
gr.Interface(fn=generate1, inputs=
|
| 157 |
|
| 158 |
|
| 159 |
if __name__ == "__main__":
|
|
|
|
| 127 |
await communicate.save(tmp_path)
|
| 128 |
yield tmp_path
|
| 129 |
|
| 130 |
+
async def generate1(TextPrompt ):
|
| 131 |
voice = Female_language_dict.get("English (UK)-Sonia- (Female)", "default_voice")
|
| 132 |
communicate = edge_tts.Communicate(TextPrompt, voice)
|
| 133 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as tmp_file:
|
| 134 |
tmp_path = tmp_file.name
|
| 135 |
await communicate.save(tmp_path)
|
| 136 |
+
yield tmp_path, TextPrompt
|
| 137 |
|
| 138 |
|
| 139 |
with gr.Blocks(theme=gr.themes.Glass(font=[gr.themes.GoogleFont("Inconsolata"), "Arial", "Arial"])) as demo:
|
|
|
|
| 153 |
user_input = gr.TextArea(label="Your Question", scale=1, 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.")
|
| 154 |
output_text = gr.TextArea(label="Sonia's Response", scale=1, interactive=False, show_copy_button=True, value=respondtxt(user_input.value), container=True )
|
| 155 |
output_audio = gr.Audio(label="Sonia's Response", scale=3, type="filepath", interactive=False, autoplay=True, elem_classes="audio", show_download_button= True, show_share_button = True, waveform_options=gr.WaveformOptions(show_recording_waveform=False), container=True )
|
| 156 |
+
gr.Interface(fn=generate1, inputs=user_input, outputs=[output_audio, output_text] live=False)
|
| 157 |
|
| 158 |
|
| 159 |
if __name__ == "__main__":
|