File size: 445 Bytes
1918f2b 1dc9545 1918f2b 67c10a3 1918f2b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
from fastapi import FastAPI ,Request ,Form
from fastapi.responses import JSONResponse
app = FastAPI()
# Root route
@app.get('/')
def hello_world():
return "Hello World taha"
@app.post('/predict')
def predict(name: str = Form(...),age: str = Form(...)): # Form(...) to accept input as web form ,may change when android /upload
# Return the submitted 'image' value as the prediction
return f"Your name is {name} \n age is {age}"
|