foodieproject / app.py
Bunpheng's picture
Update app.py
68973dc verified
raw
history blame
363 Bytes
from fastapi import FastAPI
from transformers import pipeline
import os
app = FastAPI()
pipe_flan = pipeline("text2text-generation", model="mistralai/Mistral-7B-v0.3")
@app.get("/mistral")
def mistral(input: str):
output = pipe_flan(input)
return {"output": output[0]["generated_text"]}
@app.get("/")
def greet_json():
return {"Hello": "World!"}