Spaces:
Sleeping
Sleeping
Marcos12886
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import numpy as np
|
|
|
4 |
from model import SAMPLING_RATE, clasificador, monitor
|
5 |
# modelo = monitor
|
6 |
modelo = clasificador
|
7 |
pipe = pipeline("audio-classification", model=f"A-POR-LOS-8000/distilhubert-finetuned-cry-detector", device="cuda")
|
|
|
|
|
8 |
|
9 |
def transcribe(audio):
|
10 |
_, y = audio
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import numpy as np
|
4 |
+
from huggingface_hub import login
|
5 |
from model import SAMPLING_RATE, clasificador, monitor
|
6 |
# modelo = monitor
|
7 |
modelo = clasificador
|
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
|