Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import torch
|
2 |
import os
|
3 |
-
#os.system('pip install git+https://github.com/peterwilli/audio-maister.git')
|
4 |
import gradio as gr
|
5 |
|
6 |
from audiomaister import VoiceFixer
|
@@ -20,7 +19,7 @@ def load_default_weights():
|
|
20 |
|
21 |
def inference(input_file, **kwargs):
|
22 |
checkpoint = load_default_weights()
|
23 |
-
state = torch.load(checkpoint)
|
24 |
|
25 |
main_model = VoiceFixer(state['hparams'], 1, 'vocals')
|
26 |
main_model.load_state_dict(state['weights'])
|
|
|
1 |
import torch
|
2 |
import os
|
|
|
3 |
import gradio as gr
|
4 |
|
5 |
from audiomaister import VoiceFixer
|
|
|
19 |
|
20 |
def inference(input_file, **kwargs):
|
21 |
checkpoint = load_default_weights()
|
22 |
+
state = torch.load(checkpoint, map_location=torch.device('cuda' if USE_CUDA else 'cpu'))
|
23 |
|
24 |
main_model = VoiceFixer(state['hparams'], 1, 'vocals')
|
25 |
main_model.load_state_dict(state['weights'])
|