MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / get_base_port

Function get_base_port

tests/ce/deploy/deploy.py:32–41  ·  view source on GitHub ↗

获取base port

()

Source from the content-addressed store, hash-verified

30
31
32def get_base_port():
33 """获取base port"""
34 nv_visible_devices = os.environ.get("CUDA_VISIBLE_DEVICES", "")
35 if not nv_visible_devices or nv_visible_devices.lower() == "all":
36 return 8000
37 # 提取第一个数字
38 match = re.search(r"\d+", nv_visible_devices)
39 if match:
40 return int(match.group(0)) * 100 + 8000
41 return 8000
42
43
44def is_port_in_use(port):

Callers 1

deploy.pyFile · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected