ImenMourali commited on
Commit
8169d28
·
verified ·
1 Parent(s): 8ac3d53

Update tasks/audio.py

Browse files
Files changed (1) hide show
  1. tasks/audio.py +10 -10
tasks/audio.py CHANGED
@@ -17,21 +17,21 @@ DESCRIPTION = "Random Baseline"
17
  ROUTE = "/audio"
18
 
19
 
 
20
 
21
  @router.post(ROUTE, tags=["Audio Task"],
22
  description=DESCRIPTION)
23
  async def evaluate_audio(request: AudioEvaluationRequest):
24
- from sklearn.metrics import accuracy_score
25
-
26
- # Map string predictions to numeric labels
27
- numeric_predictions = map_predictions_to_labels(predictions)
28
-
29
- # Extract true labels (already numeric)
30
- true_labels = test_dataset["label"]
31
 
32
- # Calculate accuracy
33
- accuracy = accuracy_score(true_labels, numeric_predictions)
34
- print("Accuracy:", accuracy)
 
 
 
 
 
 
35
 
36
  # Get space info
37
  username, space_url = get_space_info()
 
17
  ROUTE = "/audio"
18
 
19
 
20
+ from sklearn.metrics import accuracy_score
21
 
22
  @router.post(ROUTE, tags=["Audio Task"],
23
  description=DESCRIPTION)
24
  async def evaluate_audio(request: AudioEvaluationRequest):
 
 
 
 
 
 
 
25
 
26
+ # Map string predictions to numeric labels
27
+ numeric_predictions = map_predictions_to_labels(predictions)
28
+
29
+ # Extract true labels (already numeric)
30
+ true_labels = test_dataset["label"]
31
+
32
+ # Calculate accuracy
33
+ accuracy = accuracy_score(true_labels, numeric_predictions)
34
+ print("Accuracy:", accuracy)
35
 
36
  # Get space info
37
  username, space_url = get_space_info()