Download server.py from Hgodwarrior/Huhb3D-Synthetic-Data-Generator: direct link, hf CLI and curl.
- Browser
- Download file 333 Bytes
-
https://huggingface.co/Hgodwarrior/Huhb3D-Synthetic-Data-Generator/resolve/main/server.py
- Command line
-
hf download hf://Hgodwarrior/Huhb3D-Synthetic-Data-Generator/server.py
-
curl -L -o server.py https://huggingface.co/Hgodwarrior/Huhb3D-Synthetic-Data-Generator/resolve/main/server.py
333 Bytes
| import http.server | |
| import socketserver | |
| import os | |
| PORT = int(os.environ.get("PORT", 7860)) | |
| os.chdir(os.path.dirname(os.path.abspath(__file__))) | |
| Handler = http.server.SimpleHTTPRequestHandler | |
| with socketserver.TCPServer(("0.0.0.0", PORT), Handler) as httpd: | |
| print(f"Serving at http://0.0.0.0:{PORT}") | |
| httpd.serve_forever() | |