Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ screen = Aspecto()
|
|
31 |
with gr.Blocks(theme=gr.themes.Ocean(primary_hue="pink", neutral_hue="indigo", font=[gr.themes.GoogleFont("Montserrat"), "Playwrite England SemiJoine", "Quicksand"])) as demo:
|
32 |
textbox = gr.Textbox(label="Url")
|
33 |
with gr.Row():
|
34 |
-
button = gr.Button("
|
35 |
clear = gr.Button("Borrar")
|
36 |
output = gr.Textbox(label="Resumen")
|
37 |
output2 = gr.Audio(label="Audio")
|
@@ -40,6 +40,7 @@ with gr.Blocks(theme=gr.themes.Ocean(primary_hue="pink", neutral_hue="indigo", f
|
|
40 |
raw_image = Image.open(requests.get(url, stream=True).raw).convert('RGB')
|
41 |
inputs = processor(raw_image, return_tensors="pt").to("cpu")
|
42 |
out = model.generate(**inputs)
|
|
|
43 |
return leer(processor.decode(out[0], skip_special_tokens=True))
|
44 |
|
45 |
def leer(texto):
|
@@ -58,7 +59,7 @@ with gr.Blocks(theme=gr.themes.Ocean(primary_hue="pink", neutral_hue="indigo", f
|
|
58 |
num_waveforms_per_prompt=3,
|
59 |
generator=generator,
|
60 |
).audios
|
61 |
-
|
62 |
#sf.write("demo.wav", salida, pipe.vae.sampling_rate)
|
63 |
return audio[0].T.float().cpu().numpy()
|
64 |
|
|
|
31 |
with gr.Blocks(theme=gr.themes.Ocean(primary_hue="pink", neutral_hue="indigo", font=[gr.themes.GoogleFont("Montserrat"), "Playwrite England SemiJoine", "Quicksand"])) as demo:
|
32 |
textbox = gr.Textbox(label="Url")
|
33 |
with gr.Row():
|
34 |
+
button = gr.Button("Describir", variant="primary")
|
35 |
clear = gr.Button("Borrar")
|
36 |
output = gr.Textbox(label="Resumen")
|
37 |
output2 = gr.Audio(label="Audio")
|
|
|
40 |
raw_image = Image.open(requests.get(url, stream=True).raw).convert('RGB')
|
41 |
inputs = processor(raw_image, return_tensors="pt").to("cpu")
|
42 |
out = model.generate(**inputs)
|
43 |
+
output = processor.decode(out[0], skip_special_tokens=True)
|
44 |
return leer(processor.decode(out[0], skip_special_tokens=True))
|
45 |
|
46 |
def leer(texto):
|
|
|
59 |
num_waveforms_per_prompt=3,
|
60 |
generator=generator,
|
61 |
).audios
|
62 |
+
|
63 |
#sf.write("demo.wav", salida, pipe.vae.sampling_rate)
|
64 |
return audio[0].T.float().cpu().numpy()
|
65 |
|