root
commited on
Commit
·
ab30d87
1
Parent(s):
00af04f
music confidence
Browse files
app.py
CHANGED
@@ -268,7 +268,7 @@ def detect_music(audio_data):
|
|
268 |
label = result["label"].lower()
|
269 |
if any(music_term in label for music_term in ["music", "song", "singing", "instrument"]):
|
270 |
music_confidence = max(music_confidence, result["score"])
|
271 |
-
return music_confidence >= 0.
|
272 |
|
273 |
# Second attempt: Use manually loaded model components
|
274 |
elif 'music_processor' in globals() and 'music_model' in globals():
|
@@ -301,7 +301,7 @@ def detect_music(audio_data):
|
|
301 |
if any(music_term in label for music_term in ["music", "song", "singing", "instrument"]):
|
302 |
music_confidence = max(music_confidence, score)
|
303 |
|
304 |
-
return music_confidence >= 0.
|
305 |
|
306 |
else:
|
307 |
raise ValueError("No music detection model available")
|
|
|
268 |
label = result["label"].lower()
|
269 |
if any(music_term in label for music_term in ["music", "song", "singing", "instrument"]):
|
270 |
music_confidence = max(music_confidence, result["score"])
|
271 |
+
return music_confidence >= 0.2, results
|
272 |
|
273 |
# Second attempt: Use manually loaded model components
|
274 |
elif 'music_processor' in globals() and 'music_model' in globals():
|
|
|
301 |
if any(music_term in label for music_term in ["music", "song", "singing", "instrument"]):
|
302 |
music_confidence = max(music_confidence, score)
|
303 |
|
304 |
+
return music_confidence >= 0.2, results
|
305 |
|
306 |
else:
|
307 |
raise ValueError("No music detection model available")
|