lifespan
Browse files- server/src/main.py +2 -2
server/src/main.py
CHANGED
|
@@ -8,8 +8,6 @@ from transformers import pipeline
|
|
| 8 |
from fastapi import FastAPI
|
| 9 |
from contextlib import asynccontextmanager
|
| 10 |
|
| 11 |
-
app = FastAPI()
|
| 12 |
-
|
| 13 |
DEVICE = os.getenv('DEVICE', 'mps')
|
| 14 |
ATTN_IMPLEMENTATION = os.getenv('ATTN_IMPLEMENTATION', "sdpa")
|
| 15 |
|
|
@@ -28,6 +26,8 @@ async def lifespan(app: FastAPI):
|
|
| 28 |
transcribe_pipeline.model.to('cuda')
|
| 29 |
yield
|
| 30 |
|
|
|
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
@app.get("/")
|
|
|
|
| 8 |
from fastapi import FastAPI
|
| 9 |
from contextlib import asynccontextmanager
|
| 10 |
|
|
|
|
|
|
|
| 11 |
DEVICE = os.getenv('DEVICE', 'mps')
|
| 12 |
ATTN_IMPLEMENTATION = os.getenv('ATTN_IMPLEMENTATION', "sdpa")
|
| 13 |
|
|
|
|
| 26 |
transcribe_pipeline.model.to('cuda')
|
| 27 |
yield
|
| 28 |
|
| 29 |
+
app = FastAPI(lifespan=lifespan)
|
| 30 |
+
|
| 31 |
|
| 32 |
|
| 33 |
@app.get("/")
|