Spaces:
Paused
Paused
| from fastapi import FastAPI | |
| from fastapi.staticfiles import StaticFiles | |
| from fastapi.responses import FileResponse | |
| from transformers import pipeline | |
| #from datasets import load_dataset | |
| app = FastAPI() | |
| pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small") | |
| #Inference Augmentation: Load a dataset like SQuAD for question-answering; | |
| #to generate responses, testing zero-shot capabilities | |
| def t5(input): | |
| output = pipe_flan(input) | |
| return {"output": output[0]["generated_text"]} | |
| app.mount("/", StaticFiles(directory="static", html=True), name="static") | |
| def index() -> FileResponse: | |
| return FileResponse(path="/static/index.html", media_type="text/html") | |
| ## line-6 | |
| #dataset = load_dataset('glue', 'mrpc') | |
| #In app.py, define models/endpoints for /signup | |
| #(hash passwords with bcrypt—add bcrypt==4.2.0), | |
| #/login (JWT auth via fastapi-jwt-auth or built-in) | |