Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -17,7 +17,9 @@ templates = Jinja2Templates(directory="templates")
|
|
17 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
18 |
|
19 |
# Load models
|
20 |
-
|
|
|
|
|
21 |
groq_client = Groq(api_key=GROQ_API_KEY)
|
22 |
|
23 |
init_qdrant_collection()
|
|
|
17 |
app.mount("/static", StaticFiles(directory="static"), name="static")
|
18 |
|
19 |
# Load models
|
20 |
+
cache_dir = os.environ.get("MODEL_CACHE_DIR", "/app/cache") # Fallback to /app/cache
|
21 |
+
os.makedirs(cache_dir, exist_ok=True)
|
22 |
+
gliner_model = GLiNER.from_pretrained("urchade/gliner_medium-v2.1",cache_dir=cache_dir)
|
23 |
groq_client = Groq(api_key=GROQ_API_KEY)
|
24 |
|
25 |
init_qdrant_collection()
|