Spaces:
Sleeping
Sleeping
Download main.py from mattritchey/FastAPI_Start: direct link, hf CLI and curl.
- Browser
- Download file 473 Bytes
-
https://huggingface.co/spaces/mattritchey/FastAPI_Start/resolve/main/main.py
- Command line
-
hf download hf://spaces/mattritchey/FastAPI_Start/main.py
-
curl -L -o main.py https://huggingface.co/spaces/mattritchey/FastAPI_Start/resolve/main/main.py
473 Bytes
| # https://medium.com/@qacheampong/building-and-deploying-a-fastapi-app-with-hugging-face-9210e9b4a713 | |
| # https://huggingface.co/spaces/Queensly/FastAPI_in_Docker | |
| from fastapi import FastAPI | |
| import uvicorn | |
| app = FastAPI() | |
| #Endpoints | |
| #Root endpoints | |
| def root(): | |
| return {"API": "Sum of 2 Squares"} | |
| async def predict(number_1: int, number_2: int): | |
| prediction = number_1**2 + number_2**2 | |
| return prediction | |