Spaces:
Sleeping
Sleeping
using first 4 sec of audio to predict
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ class DFSeparationApp:
|
|
34 |
def predict(self, audio_file):
|
35 |
# Load the audio file
|
36 |
print(f"[LOG] Audio file: {audio_file}")
|
37 |
-
audio_tensor = torch.tensor(audio_file[1],dtype=torch.float).unsqueeze(0)
|
38 |
print(f"[LOG] Audio tensor shape: {audio_tensor.shape}")
|
39 |
with torch.no_grad():
|
40 |
# Make prediction
|
|
|
34 |
def predict(self, audio_file):
|
35 |
# Load the audio file
|
36 |
print(f"[LOG] Audio file: {audio_file}")
|
37 |
+
audio_tensor = torch.tensor(audio_file[1][:64600],dtype=torch.float).unsqueeze(0)
|
38 |
print(f"[LOG] Audio tensor shape: {audio_tensor.shape}")
|
39 |
with torch.no_grad():
|
40 |
# Make prediction
|