File size: 779 Bytes
ac744bd
 
9e88fc4
 
 
 
0640556
bd5bf73
 
9e88fc4
 
 
bd5bf73
9e88fc4
bd5bf73
9e88fc4
 
bd5bf73
9e88fc4
 
bd5bf73
9e88fc4
 
 
 
 
0640556
9e88fc4
 
 
5d81cd6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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")