Update app.py
Browse files
app.py
CHANGED
|
@@ -41,9 +41,10 @@ def process_audio(audio_path):
|
|
| 41 |
if sample_rate != 16000:
|
| 42 |
audio_array = torchaudio.transforms.Resample(orig_freq=sample_rate, new_freq=16000)(audio_array)
|
| 43 |
|
| 44 |
-
audio_array =
|
|
|
|
| 45 |
|
| 46 |
-
inputs = inputs = processor(audio_array, sampling_rate=16000, return_tensors="pt")
|
| 47 |
inputs = inputs.to(device, dtype=torch.bfloat16)
|
| 48 |
|
| 49 |
with torch.no_grad():
|
|
|
|
| 41 |
if sample_rate != 16000:
|
| 42 |
audio_array = torchaudio.transforms.Resample(orig_freq=sample_rate, new_freq=16000)(audio_array)
|
| 43 |
|
| 44 |
+
#audio_array = {k: v.to(device) for k, v in inputs.items()}
|
| 45 |
+
#audio_array = audio_array.to(device)
|
| 46 |
|
| 47 |
+
inputs = inputs = processor(audio_array.cpu().numpy(), sampling_rate=16000, return_tensors="pt")
|
| 48 |
inputs = inputs.to(device, dtype=torch.bfloat16)
|
| 49 |
|
| 50 |
with torch.no_grad():
|