Kangarroar commited on
Commit
a1586fe
1 Parent(s): 5b8252c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -38
app.py CHANGED
@@ -14,41 +14,3 @@ description = """
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
-
30
- # Open the file and read it into a string
31
- with open("/home/user/.local/lib/python3.8/site-packages/torch/serialization.py") as f:
32
- text = f.read()
33
-
34
- # Replace the original line with the new line
35
- 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):")
36
- # Save the modified string to the original file
37
- with open("/home/user/.local/lib/python3.8/site-packages/torch/serialization.py", "w") as f:
38
- f.write(text)
39
-
40
- print("Replaced")
41
- with open("/home/user/.local/lib/python3.8/site-packages/torch/serialization.py") as f:
42
- text = f.read()
43
- print(text)
44
-
45
- ############
46
- logging.getLogger('numba').setLevel(logging.WARNING)
47
-
48
- # 工程文件夹名,训练时用的那个
49
- project_name = "Unnamed"
50
- model_path = f'./checkpoints/Unnamed/model_ckpt_steps_192000.ckpt'
51
- config_path=f'./checkpoints/Unnamed/config.yaml'
52
- hubert_gpu=False
53
- svc_model = Svc(project_name,config_path,hubert_gpu, model_path)
54
- print('model loaded')
 
14
  </center>
15
  </p>
16
  """