File size: 294 Bytes
6299828
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from fastapi import FastAPI

app = FastAPI(title="Deploying FastAPI Apps on Huggingface")

@app.get("/", tags=["Home"])
def api_home():
    return {'detail': 'Welcome to FastAPI TextGen Tutorial!'}

@app.post("/",tags=["hello"])
def hello(input_prompt: str):
    return f"hello {input_prompt}!"