#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 # le framework de huggingface | |
app = FastAPI() | |
#pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small") | |
classifier = pipeline("automatic-speech-recognition")# la liste des pipelines de huggingface est disponible ici :https://huggingface.co/docs/transformers/quicktour | |
def t5(): | |
#output = pipe_flan(input) | |
#pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization") | |
#pipeline("file.wav") | |
return {"output":"OK"} | |
#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") | |