#import gradio as gr #gr.Interface.load("models/pyannote/speaker-diarization").launch() from fastapi import FastAPI from fastapi.staticfiles import StaticFiles from fastapi.responses import FileResponse #from pyannote.audio import Pipeline from transformers import pipeline app = FastAPI() pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small") @app.get("/") def t5(input): output = pipe_flan(input) #pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization") #pipeline("file.wav") return {"output":"OK"+output} #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")