Gabriel Bibb贸
commited on
Commit
路
18e8cca
1
Parent(s):
11719c2
Hotfix: Restore basic functionality - fix AST saturation and PANNs execution
Browse files
app.py
CHANGED
|
@@ -144,7 +144,8 @@ def predict(self, audio: np.ndarray, timestamp: float = 0.0, full_audio: np.ndar
|
|
| 144 |
# Adjust confidence for short audio
|
| 145 |
if len(audio) < self.sample_rate * 2:
|
| 146 |
confidence_factor = len(audio) / (self.sample_rate * 2)
|
| 147 |
-
speech_prob = speech_prob * (0.6 + 0.4 *
|
|
|
|
| 148 |
import numpy as np
|
| 149 |
import torch
|
| 150 |
import time
|
|
|
|
| 144 |
# Adjust confidence for short audio
|
| 145 |
if len(audio) < self.sample_rate * 2:
|
| 146 |
confidence_factor = len(audio) / (self.sample_rate * 2)
|
| 147 |
+
speech_prob = speech_prob * (0.6 + 0.4 * confidence_factor)
|
| 148 |
+
import gradio as gr
|
| 149 |
import numpy as np
|
| 150 |
import torch
|
| 151 |
import time
|