Spaces:
Runtime error
Runtime error
File size: 363 Bytes
c6cdb3c dce6ba6 c6cdb3c 217a1d1 447f9ff 26e1a97 447f9ff 68973dc f22612e 26e1a97 217a1d1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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!"}
|