Kangarroar commited on
Commit
9836b3a
1 Parent(s): a1586fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py CHANGED
@@ -14,3 +14,27 @@ description = """
14
  </center>
15
  </p>
16
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  </center>
15
  </p>
16
  """
17
+ from utils.hparams import hparams
18
+ from preprocessing.data_gen_utils import get_pitch_parselmouth,get_pitch_crepe
19
+ import numpy as np
20
+ import matplotlib.pyplot as plt
21
+ import IPython.display as ipd
22
+ import utils
23
+ import librosa
24
+ import torchcrepe
25
+ from infer import *
26
+ import logging
27
+ from infer_tools.infer_tool import *
28
+ ##EDIT FOR CPU
29
+ # Open the file and read it into a string
30
+ with open("/home/user/.local/lib/python3.8/site-packages/torch/serialization.py") as f:
31
+ text = f.read()
32
+ # Replace the original line with the new line
33
+ text = text.replace("def load(f, map_location=None, pickle_module=pickle, **pickle_load_args):", "def load(f, map_location='cpu', pickle_module=pickle, **pickle_load_args):")
34
+ # Save the modified string to the original file
35
+ with open("/home/user/.local/lib/python3.8/site-packages/torch/serialization.py", "w") as f:
36
+ f.write(text)
37
+ print("Replaced")
38
+ #with open("/home/user/.local/lib/python3.8/site-packages/torch/serialization.py") as f:
39
+ # text = f.read()
40
+ #print(text)