skytnt commited on
Commit
8cf213b
β€’
1 Parent(s): ed10f4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -15
app.py CHANGED
@@ -1,11 +1,7 @@
1
  import json
2
- import signal
3
- import sys
4
-
5
  import librosa
6
  import numpy as np
7
  import torch
8
- from psutil import process_iter
9
  from torch import no_grad, LongTensor
10
  import commons
11
  import utils
@@ -76,18 +72,7 @@ def create_vc_fn(model, hps, speaker_ids):
76
  return vc_fn
77
 
78
 
79
- def kill_proc():
80
- for proc in process_iter():
81
- for conns in proc.connections(kind='inet'):
82
- if conns.laddr.port == 7860:
83
- proc.send_signal(signal.SIGTERM if sys.platform == "win32" else signal.SIGKILL)
84
-
85
-
86
  if __name__ == '__main__':
87
- kill_proc()
88
- # I don't know why my space will restart unexpectedly and get OSError: All ports from 7860 to 7860 are in use.
89
- # So I try to kill the process which using 7860 port.
90
-
91
  models = []
92
  with open("saved_model/names.json", "r", encoding="utf-8") as f:
93
  models_names = json.load(f)
 
1
  import json
 
 
 
2
  import librosa
3
  import numpy as np
4
  import torch
 
5
  from torch import no_grad, LongTensor
6
  import commons
7
  import utils
 
72
  return vc_fn
73
 
74
 
 
 
 
 
 
 
 
75
  if __name__ == '__main__':
 
 
 
 
76
  models = []
77
  with open("saved_model/names.json", "r", encoding="utf-8") as f:
78
  models_names = json.load(f)