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...
94dea2c
square_fastapi
/
square
/
app.py
stpete2
Update square/app.py
94dea2c
verified
11 months ago
raw
Copy download link
history
blame
214 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}