test / app.py
mskov's picture
Update app.py
d9a32db
raw
history blame
437 Bytes
# TEST MODEL
from transformers import pipeline
classifier = pipeline(task="zero-shot-audio-classification", model="mskov/roberta-base-toxicity")
# classifier = pipeline(model="mskov/roberta-base-toxicity")
audio = "./test/candy-bar-chewing.wav"
classifier(audio, candidate_labels=["Sound of a dog", "Sound of vaccum cleaner", "chewing", "sneezing"])
predicted_label = result[0]["label"]
print(f"Predicted label: {predicted_label}")