Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ print("Model moved to GPU successfully")
|
|
14 |
|
15 |
|
16 |
@spaces.GPU
|
17 |
-
def
|
18 |
return classifier({"sampling_rate": sr, "raw": audio_segment})
|
19 |
|
20 |
|
@@ -49,7 +49,7 @@ def predict_dialect(audio):
|
|
49 |
print(f"Processing audio: sample rate={sr}, shape={audio_array.shape}")
|
50 |
|
51 |
# Classify the dialect
|
52 |
-
predictions =
|
53 |
|
54 |
# Format results for display
|
55 |
results = {}
|
|
|
14 |
|
15 |
|
16 |
@spaces.GPU
|
17 |
+
def predict(audio_segment, sr=16000):
|
18 |
return classifier({"sampling_rate": sr, "raw": audio_segment})
|
19 |
|
20 |
|
|
|
49 |
print(f"Processing audio: sample rate={sr}, shape={audio_array.shape}")
|
50 |
|
51 |
# Classify the dialect
|
52 |
+
predictions = predict(sr=sr, audio_segment=audio_array)
|
53 |
|
54 |
# Format results for display
|
55 |
results = {}
|