Ld75 commited on
Commit
9e88fc4
·
1 Parent(s): ac744bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -3
app.py CHANGED
@@ -1,8 +1,31 @@
1
  #import gradio as gr
2
  #gr.Interface.load("models/pyannote/speaker-diarization").launch()
 
 
 
 
3
  from pyannote.audio import Pipeline
4
 
5
- pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- # inference on the whole file
8
- pipeline("file.wav")
 
1
  #import gradio as gr
2
  #gr.Interface.load("models/pyannote/speaker-diarization").launch()
3
+
4
+ from fastapi import FastAPI
5
+ from fastapi.staticfiles import StaticFiles
6
+ from fastapi.responses import FileResponse
7
  from pyannote.audio import Pipeline
8
 
9
+ #from transformers import pipeline
10
+
11
+ app = FastAPI()
12
+
13
+ #pipe_flan = pipeline("text2text-generation", model="google/flan-t5-small")
14
+
15
+ @app.get("/healthcheck")
16
+ def t5(input):
17
+
18
+ #output = pipe_flan(input)
19
+ #pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
20
+ #pipeline("file.wav")
21
+ return {"output":"OK"}
22
+
23
+ #app.mount("/", StaticFiles(directory="static", html=True), name="static")
24
+
25
+ # @app.get("/")
26
+ #def index() -> FileResponse:
27
+ return FileResponse(path="/app/static/index.html", media_type="text/html")
28
+
29
+
30
+
31