barto17 commited on
Commit
e62699f
·
1 Parent(s): 4437267

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -17,6 +17,7 @@ pipe = pipeline("audio-classification", model=model_id, device=device)
17
 
18
 
19
  def classify_audio(filepath):
 
20
  """
21
  Goes from
22
  [{'score': 0.8339303731918335, 'label': 'country'},
@@ -29,7 +30,9 @@ def classify_audio(filepath):
29
  outputs = {}
30
  for p in preds:
31
  outputs[p["label"]] = p["score"]
32
- return outputs
 
 
33
 
34
 
35
  title = "🎵 Music Genre Classifier"
 
17
 
18
 
19
  def classify_audio(filepath):
20
+ start_time = timer()
21
  """
22
  Goes from
23
  [{'score': 0.8339303731918335, 'label': 'country'},
 
30
  outputs = {}
31
  for p in preds:
32
  outputs[p["label"]] = p["score"]
33
+
34
+ pred_time = round(timer() - start_time, 5)
35
+ return outputs, pred_time
36
 
37
 
38
  title = "🎵 Music Genre Classifier"