Spaces:
Runtime error
Runtime error
- app.py +0 -5
- speech-gen.py +9 -0
app.py
CHANGED
@@ -1,17 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
-
import torch
|
4 |
|
5 |
MODEL_NAME = "openai/whisper-large-v3"
|
6 |
BATCH_SIZE = 8
|
7 |
|
8 |
-
device = 0 if torch.cuda.is_available() else "cpu"
|
9 |
-
|
10 |
asr = pipeline(
|
11 |
task="automatic-speech-recognition",
|
12 |
model=MODEL_NAME,
|
13 |
-
chunk_length_s=30,
|
14 |
-
device=device,
|
15 |
)
|
16 |
|
17 |
def transcribe(filepath):
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
|
|
3 |
|
4 |
MODEL_NAME = "openai/whisper-large-v3"
|
5 |
BATCH_SIZE = 8
|
6 |
|
|
|
|
|
7 |
asr = pipeline(
|
8 |
task="automatic-speech-recognition",
|
9 |
model=MODEL_NAME,
|
|
|
|
|
10 |
)
|
11 |
|
12 |
def transcribe(filepath):
|
speech-gen.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
synthesizer = pipeline("text-to-speech", "suno/bark")
|
4 |
+
|
5 |
+
|
6 |
+
def generate_speech(text):
|
7 |
+
result = synthesizer(text)
|
8 |
+
print(synthesizer(text))
|
9 |
+
return synthesizer(text)
|