Zeel Somaiya
Add: 2 routes to build a simple application
46a2fb4 unverified
raw
history blame contribute delete
295 Bytes
from fastapi import FastAPI
from transformers import pipeline
pipe = pipeline("text2text-generation", model="google/flan-t5-base")
app = FastAPI()
@app.get('/')
def home():
return {"hello": "people"}
@app.get('/ask')
def ask(prompt: str):
result = pipe(prompt)
return result[0]