Download server.py from dragxd/oneapi: direct link, hf CLI and curl.
- Browser
- Download file 454 Bytes
-
https://huggingface.co/spaces/dragxd/oneapi/resolve/main/server.py
- Command line
-
hf download hf://spaces/dragxd/oneapi/server.py
-
curl -L -o server.py https://huggingface.co/spaces/dragxd/oneapi/resolve/main/server.py
454 Bytes
| import os | |
| import uvicorn | |
| from fastapi import FastAPI | |
| from fastapi.responses import RedirectResponse | |
| app = FastAPI(docs_url=None, redoc_url="/") | |
| def redirect_to_oneapi(): | |
| return RedirectResponse(url="http://localhost:8080/") | |
| def hello(): | |
| return {"message": "OneApi is running on port 8080", "oneapi_url": "http://localhost:8080/"} | |
| if __name__ == "__main__": | |
| uvicorn.run(app, host="0.0.0.0", port=7860) |