Spaces:
Sleeping
Sleeping
Marcos12886
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import numpy as np
|
4 |
-
from
|
5 |
-
|
6 |
-
# modelo =
|
7 |
-
|
8 |
-
pipe = pipeline("audio-classification", model=f"A-POR-LOS-8000/distilhubert-finetuned-cry-detector", device="cuda")
|
9 |
-
token = os.getenv('HF_ACCESS_TOKEN')
|
10 |
-
login(token, add_to_git_credential=True)
|
11 |
|
12 |
def transcribe(audio):
|
13 |
_, y = audio
|
@@ -28,3 +25,4 @@ demo = gr.Interface(
|
|
28 |
"text",
|
29 |
)
|
30 |
demo.launch()
|
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import numpy as np
|
4 |
+
from model import SAMPLING_RATE
|
5 |
+
modelo = "mixed-data"
|
6 |
+
# modelo = "cry-detector"
|
7 |
+
pipe = pipeline("audio-classification", model=f"A-POR-LOS-8000/distilhubert-finetuned-{modelo}")
|
|
|
|
|
|
|
8 |
|
9 |
def transcribe(audio):
|
10 |
_, y = audio
|
|
|
25 |
"text",
|
26 |
)
|
27 |
demo.launch()
|
28 |
+
|