Qi28 commited on
Commit
64aadcd
·
verified ·
1 Parent(s): a76ef0e

Update activate_port.py

Browse files
Files changed (1) hide show
  1. activate_port.py +5 -2
activate_port.py CHANGED
@@ -38,8 +38,11 @@ class Func:
38
  json.dump(data, file, ensure_ascii=False)
39
 
40
  def activate_port(port, env=None):
41
- Func.register_port(port)
42
- print(f'访问 /gradio/{port}')
 
 
 
43
 
44
  if __name__ == "__main__":
45
  env = os.environ.copy()
 
38
  json.dump(data, file, ensure_ascii=False)
39
 
40
  def activate_port(port, env=None):
41
+ try:
42
+ Func.register_port(port)
43
+ print(f'访问 /gradio/{port}')
44
+ except Exception as e:
45
+ print(f"激活端口 {port} 失败: {e}")
46
 
47
  if __name__ == "__main__":
48
  env = os.environ.copy()