Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,8 +37,8 @@ with gr.Blocks(theme=gr.themes.Ocean(primary_hue="pink", neutral_hue="indigo", f
|
|
37 |
raw_image = Image.open(requests.get(url, stream=True).raw).convert('RGB')
|
38 |
inputs = processor(raw_image, return_tensors="pt").to("cpu")
|
39 |
out = model.generate(**inputs)
|
40 |
-
|
41 |
-
return
|
42 |
|
43 |
def leer(texto):
|
44 |
pipe = StableAudioPipeline.from_pretrained("stabilityai/stable-audio-open-1.0")
|
@@ -60,9 +60,9 @@ with gr.Blocks(theme=gr.themes.Ocean(primary_hue="pink", neutral_hue="indigo", f
|
|
60 |
).audios
|
61 |
|
62 |
#sf.write("demo.wav", salida, pipe.vae.sampling_rate)
|
63 |
-
return audio[0].T.float().cpu().numpy()
|
64 |
|
65 |
|
66 |
-
button.click(describir, [textbox],
|
67 |
|
68 |
demo.launch(debug=True)
|
|
|
37 |
raw_image = Image.open(requests.get(url, stream=True).raw).convert('RGB')
|
38 |
inputs = processor(raw_image, return_tensors="pt").to("cpu")
|
39 |
out = model.generate(**inputs)
|
40 |
+
leer(processor.decode(out[0], skip_special_tokens=True))
|
41 |
+
return processor.decode(out[0], skip_special_tokens=True)
|
42 |
|
43 |
def leer(texto):
|
44 |
pipe = StableAudioPipeline.from_pretrained("stabilityai/stable-audio-open-1.0")
|
|
|
60 |
).audios
|
61 |
|
62 |
#sf.write("demo.wav", salida, pipe.vae.sampling_rate)
|
63 |
+
return output2 = audio[0].T.float().cpu().numpy(), pipe.vae.sampling_rate
|
64 |
|
65 |
|
66 |
+
button.click(describir, [textbox], output)
|
67 |
|
68 |
demo.launch(debug=True)
|