File size: 532 Bytes
02b4c7b
 
 
 
 
 
 
 
 
 
d7cc957
 
 
02b4c7b
 
 
 
 
d7cc957
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse

from transformers import pipeline

app = FastAPI()

pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")

@app.get("/query_gorilla")
def query_gorilla(input):
    return {"output": "Test Result"}

app.mount("/", StaticFiles(directory="static", html=True), name="static")

@app.get("/")
def index() -> FileResponse:
    return FileResponse(path="/app/static/index.html", media_type="text/html")