Spaces:
Runtime error
Runtime error
JuanjoRosquete
commited on
Commit
•
923fe92
1
Parent(s):
887b3a4
Add application file
Browse files
app.py
CHANGED
@@ -21,6 +21,7 @@ from transformers import pipeline
|
|
21 |
import gradio as gr
|
22 |
import os
|
23 |
import torch
|
|
|
24 |
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
25 |
|
26 |
|
@@ -39,6 +40,7 @@ def transcribe_text_audio(mic=None, file=None):
|
|
39 |
audio = file
|
40 |
else:
|
41 |
return "No se ha detectado ninguna entrada de audio"
|
|
|
42 |
transcription = model(audio)["text"]
|
43 |
|
44 |
image = image_model(transcription).images[0]
|
@@ -53,5 +55,10 @@ gr.Interface(
|
|
53 |
gr.Audio(sources=["microphone"], type="filepath"),
|
54 |
gr.Audio(sources=["upload"], type="filepath"),
|
55 |
],
|
56 |
-
outputs=[
|
|
|
|
|
|
|
|
|
|
|
57 |
).launch()
|
|
|
21 |
import gradio as gr
|
22 |
import os
|
23 |
import torch
|
24 |
+
import accelerate
|
25 |
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
26 |
|
27 |
|
|
|
40 |
audio = file
|
41 |
else:
|
42 |
return "No se ha detectado ninguna entrada de audio"
|
43 |
+
|
44 |
transcription = model(audio)["text"]
|
45 |
|
46 |
image = image_model(transcription).images[0]
|
|
|
55 |
gr.Audio(sources=["microphone"], type="filepath"),
|
56 |
gr.Audio(sources=["upload"], type="filepath"),
|
57 |
],
|
58 |
+
outputs=[
|
59 |
+
gr.Textbox(label="Transcripción del Audio"),
|
60 |
+
gr.Image(label="Imagen Generada")
|
61 |
+
],
|
62 |
+
title="[ESpañol] - Audio -> Texto -> Imagen",
|
63 |
+
description="Esta aplicación transcribe el audio a texto para convertirlo en una imagen descriptiva."
|
64 |
).launch()
|