hieupham14022003
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import torchaudio
|
4 |
-
from torch.
|
5 |
|
6 |
from network.models import FilterBandTFGridnet, ResemblyzerVoiceEncoder
|
7 |
|
@@ -54,7 +54,7 @@ def seprate(mixed_voice_path, clean_voice_path, drop_down):
|
|
54 |
e_mix = emb(mixed_voice)
|
55 |
e = torch.cat([e,e_mix],dim=1)
|
56 |
mixed_voice = torchaudio.functional.resample(mixed_voice, rate, 8000)
|
57 |
-
with autocast():
|
58 |
with torch.no_grad():
|
59 |
yHat = model(
|
60 |
mixed_voice,
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import torchaudio
|
4 |
+
from torch.amp import autocast
|
5 |
|
6 |
from network.models import FilterBandTFGridnet, ResemblyzerVoiceEncoder
|
7 |
|
|
|
54 |
e_mix = emb(mixed_voice)
|
55 |
e = torch.cat([e,e_mix],dim=1)
|
56 |
mixed_voice = torchaudio.functional.resample(mixed_voice, rate, 8000)
|
57 |
+
with autocast(device_type='cpu', dtype=torch.bfloat16):
|
58 |
with torch.no_grad():
|
59 |
yHat = model(
|
60 |
mixed_voice,
|