Spaces:
Sleeping
Sleeping
Update vectordb_utils.py
Browse files- vectordb_utils.py +3 -2
vectordb_utils.py
CHANGED
@@ -4,8 +4,9 @@ from qdrant_client import QdrantClient
|
|
4 |
from qdrant_client.models import VectorParams, Distance, PointStruct
|
5 |
from sentence_transformers import SentenceTransformer
|
6 |
import uuid
|
7 |
-
|
8 |
-
|
|
|
9 |
qdrant = QdrantClient(":memory:")
|
10 |
collection_name = "customer_support_docsv1"
|
11 |
|
|
|
4 |
from qdrant_client.models import VectorParams, Distance, PointStruct
|
5 |
from sentence_transformers import SentenceTransformer
|
6 |
import uuid
|
7 |
+
cache_dir = os.environ.get("MODEL_CACHE_DIR", "/app/cache") # Fallback to /app/cache
|
8 |
+
os.makedirs(cache_dir, exist_ok=True)
|
9 |
+
encoder =SentenceTransformer("all-MiniLM-L6-v2", cache_folder=cache_dir)
|
10 |
qdrant = QdrantClient(":memory:")
|
11 |
collection_name = "customer_support_docsv1"
|
12 |
|