Spaces:
Runtime error
Runtime error
Load model at startup
Browse files- app/main.py +5 -0
app/main.py
CHANGED
|
@@ -11,6 +11,7 @@ from admin import admin_functions as admin
|
|
| 11 |
from utils.db import UserFaceEmbeddingFunction,ChromaDBFaceHelper
|
| 12 |
from api import userlogin, userlogout, userchat, userupload
|
| 13 |
from utils.db import ChromaDBFaceHelper
|
|
|
|
| 14 |
|
| 15 |
app = FastAPI()
|
| 16 |
|
|
@@ -39,7 +40,11 @@ async def startup_event():
|
|
| 39 |
# Assuming chromadb persistent store client for APIs is in helper
|
| 40 |
db_path = CHROMADB_LOC
|
| 41 |
chromadb_face_helper = ChromaDBFaceHelper(db_path) # Used by APIs
|
|
|
|
| 42 |
# Perform any other startup tasks here
|
|
|
|
|
|
|
|
|
|
| 43 |
print(f"MODEL_PATH in main.py = {os.getenv('MODEL_PATH')} ")
|
| 44 |
|
| 45 |
# Mount static files
|
|
|
|
| 11 |
from utils.db import UserFaceEmbeddingFunction,ChromaDBFaceHelper
|
| 12 |
from api import userlogin, userlogout, userchat, userupload
|
| 13 |
from utils.db import ChromaDBFaceHelper
|
| 14 |
+
from utils.chat_rag import load_llm
|
| 15 |
|
| 16 |
app = FastAPI()
|
| 17 |
|
|
|
|
| 40 |
# Assuming chromadb persistent store client for APIs is in helper
|
| 41 |
db_path = CHROMADB_LOC
|
| 42 |
chromadb_face_helper = ChromaDBFaceHelper(db_path) # Used by APIs
|
| 43 |
+
|
| 44 |
# Perform any other startup tasks here
|
| 45 |
+
# Load the LLM is a singleton class call
|
| 46 |
+
load_llm()
|
| 47 |
+
|
| 48 |
print(f"MODEL_PATH in main.py = {os.getenv('MODEL_PATH')} ")
|
| 49 |
|
| 50 |
# Mount static files
|