Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
|
4 |
from diffusers import DiffusionPipeline
|
5 |
from transformers import (
|
6 |
WhisperForConditionalGeneration,
|
@@ -27,6 +27,15 @@ diffuser_pipeline = DiffusionPipeline.from_pretrained(
|
|
27 |
diffuser_pipeline.enable_attention_slicing()
|
28 |
diffuser_pipeline = diffuser_pipeline.to(device)
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
#ββββββββββββββββββββββββββββββββββββββββββββ
|
31 |
# GRADIO SETUP
|
32 |
title = "Speech to Diffusion β’ Community Pipeline"
|
@@ -51,8 +60,8 @@ def speech_to_text(audio_sample):
|
|
51 |
ββββββββ
|
52 |
""")
|
53 |
|
54 |
-
output = diffuser_pipeline(audio_sample[1])
|
55 |
-
|
56 |
print(f"""
|
57 |
ββββββββ
|
58 |
output: {output}
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
from datasets import load_dataset
|
4 |
from diffusers import DiffusionPipeline
|
5 |
from transformers import (
|
6 |
WhisperForConditionalGeneration,
|
|
|
27 |
diffuser_pipeline.enable_attention_slicing()
|
28 |
diffuser_pipeline = diffuser_pipeline.to(device)
|
29 |
|
30 |
+
#ββββββββββββββββββββββββββββββββββββββββββββ
|
31 |
+
# TESTING WITH DATASET
|
32 |
+
ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
|
33 |
+
|
34 |
+
audio_sample = ds[3]
|
35 |
+
|
36 |
+
text = audio_sample["text"].lower()
|
37 |
+
speech_data = audio_sample["audio"]["array"]
|
38 |
+
|
39 |
#ββββββββββββββββββββββββββββββββββββββββββββ
|
40 |
# GRADIO SETUP
|
41 |
title = "Speech to Diffusion β’ Community Pipeline"
|
|
|
60 |
ββββββββ
|
61 |
""")
|
62 |
|
63 |
+
#output = diffuser_pipeline(audio_sample[1])
|
64 |
+
output = diffuser_pipeline(speech_data)
|
65 |
print(f"""
|
66 |
ββββββββ
|
67 |
output: {output}
|