Spaces:
Sleeping
Sleeping
Commit
·
e8aa27e
1
Parent(s):
3fb48f1
Update app
Browse files
app.py
CHANGED
|
@@ -1,13 +1,19 @@
|
|
| 1 |
from transformers import pipeline
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
pipe = pipeline(model="matteocirca/whisper-small-it")
|
| 5 |
# pipe = pipeline(model="openai/whisper-small")
|
|
|
|
|
|
|
| 6 |
segments = []
|
|
|
|
| 7 |
def audio2segments(audio,word):
|
| 8 |
global segments
|
| 9 |
if not segments:
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
elif not word:
|
| 12 |
return "No word detected"
|
| 13 |
else:
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
import gradio as gr
|
| 3 |
+
from transformers import WhisperForConditionalGeneration
|
| 4 |
|
| 5 |
pipe = pipeline(model="matteocirca/whisper-small-it")
|
| 6 |
# pipe = pipeline(model="openai/whisper-small")
|
| 7 |
+
# model = WhisperForConditionalGeneration.from_pretrained("matteocirca/whisper-small-it")
|
| 8 |
+
|
| 9 |
segments = []
|
| 10 |
+
|
| 11 |
def audio2segments(audio,word):
|
| 12 |
global segments
|
| 13 |
if not segments:
|
| 14 |
+
print(pipe(audio).keys())
|
| 15 |
+
# segments = pipe(audio)["segments"]
|
| 16 |
+
# segments = model.transcribe(audio)["segments"]
|
| 17 |
elif not word:
|
| 18 |
return "No word detected"
|
| 19 |
else:
|