Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI | |
| # Use a pipeline as a high-level helper | |
| from transformers import pipeline | |
| pipe = pipeline("text2text-generation", model="google/flan-t5-base") | |
| app = FastAPI() | |
| def greet_json(): | |
| return {"Hello": "World!"} | |
| def ask(prompt:str): | |
| result = pipe(prompt) | |
| return result | |
| # docker run --name=fastapi -p 7860:7860 fastapi-hf |