Hgodwarrior's picture
Upload server.py with huggingface_hub
db8c654 verified
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()