Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
stpete2
/
square_fastapi
like
0
Sleeping
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
64dca89
square_fastapi
/
app.py
stpete2
Create app.py
d7ff1c2
verified
11 months ago
raw
Copy download link
history
blame
215 Bytes
from
fastapi
import
FastAPI
from
pydantic
import
BaseModel
app = FastAPI()
class
InputData
(
BaseModel
):
x:
float
@app.post(
"/square"
)
def
double_number
(
data: InputData
):
return
{
"result"
: data.x * data.x}