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