Update activate_port.py
Browse files- 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 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
| 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()
|