whisper / app.py
legusxyz's picture
Update app.py
edf3685 verified
raw
history blame
413 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
# Sample request model
class Item(BaseModel):
name: str
description: str
price: float
tax: float
# Basic GET endpoint
@app.get("/")
def read_root():
return {"message": "Welcome to the FastAPI app on Hugging Face Spaces!"}
# POST endpoint
@app.post("/items/")
def create_item(item: Item):
return {"item": item}