Spaces:
Running
on
Zero
Running
on
Zero
roychao19477
commited on
Commit
·
306a1c8
1
Parent(s):
6885b7a
Upload
Browse files
app.py
CHANGED
@@ -44,11 +44,13 @@ compress_ff = model_cfg["compress_factor"]
|
|
44 |
def enhance(filepath):
|
45 |
global model
|
46 |
if model is None:
|
|
|
47 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
48 |
model = SEMamba(cfg).to(device)
|
49 |
sdict = torch.load(ckpt, map_location=device)
|
50 |
model.load_state_dict(sdict["generator"])
|
51 |
model.eval()
|
|
|
52 |
|
53 |
# load & (if needed) resample to model SR
|
54 |
wav, orig_sr = librosa.load(filepath, sr=None)
|
|
|
44 |
def enhance(filepath):
|
45 |
global model
|
46 |
if model is None:
|
47 |
+
print("loading model")
|
48 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
49 |
model = SEMamba(cfg).to(device)
|
50 |
sdict = torch.load(ckpt, map_location=device)
|
51 |
model.load_state_dict(sdict["generator"])
|
52 |
model.eval()
|
53 |
+
print("Finished.")
|
54 |
|
55 |
# load & (if needed) resample to model SR
|
56 |
wav, orig_sr = librosa.load(filepath, sr=None)
|