Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import torch
|
|
| 6 |
|
| 7 |
|
| 8 |
pipe1 = pipeline("automatic-speech-recognition", model="openai/whisper-base")
|
| 9 |
-
pipe2 = pipeline("summarization", model="facebook/bart-large-cnn")
|
| 10 |
#pipe3 = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5")
|
| 11 |
#pipe3.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 12 |
|
|
@@ -16,18 +16,20 @@ def audio_to_image(audio):
|
|
| 16 |
|
| 17 |
transcription_text = transcription['text']
|
| 18 |
|
| 19 |
-
summary = pipe2(transcription_text, max_length=50, min_length=10, do_sample=False)
|
| 20 |
-
summary_text = summary[0]['summary_text']
|
| 21 |
|
| 22 |
#prompt = summary_text
|
| 23 |
#image = pipe3(prompt).images[0]
|
| 24 |
|
| 25 |
#return image
|
| 26 |
-
print("Transcription:", transcription_text)
|
| 27 |
-
print("Summary:", summary_text)
|
| 28 |
-
return transcription_text, summary_text
|
|
|
|
| 29 |
|
| 30 |
|
| 31 |
#demo = gr.Interface(fn=audio_to_image, inputs=gr.Audio(), outputs="image")
|
| 32 |
-
demo = gr.Interface(fn=audio_to_image, inputs=gr.Audio(), outputs=[gr.Textbox(label="Transcription"), gr.Textbox(label="Summary")])
|
|
|
|
| 33 |
demo.launch(share=True)
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
pipe1 = pipeline("automatic-speech-recognition", model="openai/whisper-base")
|
| 9 |
+
#pipe2 = pipeline("summarization", model="facebook/bart-large-cnn")
|
| 10 |
#pipe3 = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5")
|
| 11 |
#pipe3.to("cuda" if torch.cuda.is_available() else "cpu")
|
| 12 |
|
|
|
|
| 16 |
|
| 17 |
transcription_text = transcription['text']
|
| 18 |
|
| 19 |
+
#summary = pipe2(transcription_text, max_length=50, min_length=10, do_sample=False)
|
| 20 |
+
#summary_text = summary[0]['summary_text']
|
| 21 |
|
| 22 |
#prompt = summary_text
|
| 23 |
#image = pipe3(prompt).images[0]
|
| 24 |
|
| 25 |
#return image
|
| 26 |
+
#print("Transcription:", transcription_text)
|
| 27 |
+
#print("Summary:", summary_text)
|
| 28 |
+
#return transcription_text, summary_text
|
| 29 |
+
return transcription_text
|
| 30 |
|
| 31 |
|
| 32 |
#demo = gr.Interface(fn=audio_to_image, inputs=gr.Audio(), outputs="image")
|
| 33 |
+
#demo = gr.Interface(fn=audio_to_image, inputs=gr.Audio(), outputs=[gr.Textbox(label="Transcription"), gr.Textbox(label="Summary")])
|
| 34 |
+
demo = gr.Interface(fn=audio_to_image, inputs=gr.Audio(), outputs="text")
|
| 35 |
demo.launch(share=True)
|