Tim Luka Horstmann
commited on
Commit
·
e8ba1ec
1
Parent(s):
8356d0c
No startup
Browse files- __pycache__/app.cpython-311.pyc +0 -0
- __pycache__/app.cpython-312.pyc +0 -0
- app.py +11 -11
__pycache__/app.cpython-311.pyc
CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
|
|
__pycache__/app.cpython-312.pyc
ADDED
Binary file (15.6 kB). View file
|
|
app.py
CHANGED
@@ -229,17 +229,17 @@ async def ram_usage():
|
|
229 |
logger.error(f"Error retrieving RAM usage: {str(e)}")
|
230 |
raise HTTPException(status_code=500, detail=f"Error retrieving RAM usage: {str(e)}")
|
231 |
|
232 |
-
@app.on_event("startup")
|
233 |
-
async def warm_up_model():
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
|
244 |
# Add a background task to keep the model warm
|
245 |
@app.on_event("startup")
|
|
|
229 |
logger.error(f"Error retrieving RAM usage: {str(e)}")
|
230 |
raise HTTPException(status_code=500, detail=f"Error retrieving RAM usage: {str(e)}")
|
231 |
|
232 |
+
# @app.on_event("startup")
|
233 |
+
# async def warm_up_model():
|
234 |
+
# logger.info("Warming up the model...")
|
235 |
+
# dummy_query = "Hello"
|
236 |
+
# dummy_history = []
|
237 |
+
# async for _ in stream_response(dummy_query, dummy_history):
|
238 |
+
# pass
|
239 |
+
# logger.info("Model warm-up completed.")
|
240 |
+
# # Log initial RAM usage
|
241 |
+
# ram_stats = get_ram_usage()
|
242 |
+
# logger.info(f"Initial RAM usage after startup: {ram_stats}")
|
243 |
|
244 |
# Add a background task to keep the model warm
|
245 |
@app.on_event("startup")
|