MCPcopy Create free account
hub / github.com/Alpha-VLLM/LLaMA2-Accessory / find_free_port

Function find_free_port

Large-DiT-ImageNet/sample.py:116–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114
115
116def find_free_port() -> int:
117 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
118 sock.bind(("", 0))
119 port = sock.getsockname()[1]
120 sock.close()
121 return port
122
123
124if __name__ == "__main__":

Callers 1

sample.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected