Mrkomiljon commited on
Commit
69452e3
·
verified ·
1 Parent(s): e04d1d4

Update app.py

Browse files

updated output path

Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -65,13 +65,12 @@ def predict_audio(file_path):
65
 
66
  class_name = id2label.get(predicted_label, "Unknown Class")
67
 
68
- return {
69
- "Class": class_name,
70
- "label": int(predicted_label),
71
- "Confidence": float(confidence)
72
- }
73
  except Exception as e:
74
- return {"error": str(e)}
 
75
 
76
  # Gradio interfeysi
77
  iface = gr.Interface(
 
65
 
66
  class_name = id2label.get(predicted_label, "Unknown Class")
67
 
68
+ # Return alohida qiymatlar
69
+ return class_name, float(confidence)
70
+
 
 
71
  except Exception as e:
72
+ # Xatolik bo'lsa
73
+ return "Error", str(e)
74
 
75
  # Gradio interfeysi
76
  iface = gr.Interface(