Update tasks/audio.py
Browse files- tasks/audio.py +1 -11
tasks/audio.py
CHANGED
|
@@ -239,17 +239,7 @@ for audio_data in test_dataset["audio"]:
|
|
| 239 |
|
| 240 |
print("Predictions:", predictions)
|
| 241 |
|
| 242 |
-
|
| 243 |
-
"""
|
| 244 |
-
Maps string predictions to numeric labels:
|
| 245 |
-
- "chainsaw" -> 0
|
| 246 |
-
- any other class -> 1
|
| 247 |
-
Args:
|
| 248 |
-
predictions (list of str): List of class name predictions.
|
| 249 |
-
Returns:
|
| 250 |
-
list of int: Mapped numeric labels.
|
| 251 |
-
"""
|
| 252 |
-
return [0 if pred == "chainsaw" else 1 for pred in predictions]
|
| 253 |
|
| 254 |
#--------------------------------------------------------------------------------------------
|
| 255 |
# YOUR MODEL INFERENCE STOPS HERE
|
|
|
|
| 239 |
|
| 240 |
print("Predictions:", predictions)
|
| 241 |
|
| 242 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
|
| 244 |
#--------------------------------------------------------------------------------------------
|
| 245 |
# YOUR MODEL INFERENCE STOPS HERE
|