Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import torch
|
|
| 3 |
from transformers import AutoModelForAudioClassification, AutoFeatureExtractor
|
| 4 |
|
| 5 |
# Load model directly from HF Hub
|
| 6 |
-
repo_name = "
|
| 7 |
model = AutoModelForAudioClassification.from_pretrained(repo_name)
|
| 8 |
feature_extractor = AutoFeatureExtractor.from_pretrained(repo_name)
|
| 9 |
|
|
@@ -23,7 +23,7 @@ def predict(audio):
|
|
| 23 |
|
| 24 |
demo = gr.Interface(
|
| 25 |
fn=predict,
|
| 26 |
-
inputs=gr.Audio(type="numpy"),
|
| 27 |
outputs=gr.Label(),
|
| 28 |
title="Audio Classifier"
|
| 29 |
)
|
|
|
|
| 3 |
from transformers import AutoModelForAudioClassification, AutoFeatureExtractor
|
| 4 |
|
| 5 |
# Load model directly from HF Hub
|
| 6 |
+
repo_name = "your-hf-username/your-model-name"
|
| 7 |
model = AutoModelForAudioClassification.from_pretrained(repo_name)
|
| 8 |
feature_extractor = AutoFeatureExtractor.from_pretrained(repo_name)
|
| 9 |
|
|
|
|
| 23 |
|
| 24 |
demo = gr.Interface(
|
| 25 |
fn=predict,
|
| 26 |
+
inputs=gr.Audio(type="numpy"),
|
| 27 |
outputs=gr.Label(),
|
| 28 |
title="Audio Classifier"
|
| 29 |
)
|