Spaces:
Sleeping
Sleeping
Commit ·
b4d1695
1
Parent(s): b522563
HF testing
Browse files- app/services/vector_store.py +5 -1
- requirements.txt +2 -1
app/services/vector_store.py
CHANGED
|
@@ -8,11 +8,15 @@ from app.config import params
|
|
| 8 |
# Paths for vector store and metadata
|
| 9 |
VECTOR_STORE_DIR = "/app/data"
|
| 10 |
os.makedirs(VECTOR_STORE_DIR, exist_ok=True)
|
|
|
|
| 11 |
INDEX_PATH = os.path.join(VECTOR_STORE_DIR, params["paths"]["index_file"])
|
| 12 |
META_PATH = os.path.join(VECTOR_STORE_DIR, params["paths"]["metadata_file"])
|
| 13 |
|
| 14 |
# Embedding model
|
| 15 |
-
EMBED_MODEL = SentenceTransformer(
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
def embed_texts(texts: List[str]):
|
| 18 |
"""
|
|
|
|
| 8 |
# Paths for vector store and metadata
|
| 9 |
VECTOR_STORE_DIR = "/app/data"
|
| 10 |
os.makedirs(VECTOR_STORE_DIR, exist_ok=True)
|
| 11 |
+
os.makedirs("/app/cache", exist_ok=True)
|
| 12 |
INDEX_PATH = os.path.join(VECTOR_STORE_DIR, params["paths"]["index_file"])
|
| 13 |
META_PATH = os.path.join(VECTOR_STORE_DIR, params["paths"]["metadata_file"])
|
| 14 |
|
| 15 |
# Embedding model
|
| 16 |
+
EMBED_MODEL = SentenceTransformer(
|
| 17 |
+
params["embedding"]["model_name"],
|
| 18 |
+
cache_folder="/app/cache"
|
| 19 |
+
)
|
| 20 |
|
| 21 |
def embed_texts(texts: List[str]):
|
| 22 |
"""
|
requirements.txt
CHANGED
|
@@ -27,7 +27,8 @@ pdf2image --trusted-host=pypi.org --trusted-host=files.pythonhosted.org
|
|
| 27 |
python-dotenv
|
| 28 |
requests
|
| 29 |
tiktoken
|
| 30 |
-
sentence-transformers
|
|
|
|
| 31 |
faiss-cpu
|
| 32 |
pytesseract
|
| 33 |
nltk
|
|
|
|
| 27 |
python-dotenv
|
| 28 |
requests
|
| 29 |
tiktoken
|
| 30 |
+
sentence-transformers==2.6.1
|
| 31 |
+
transformers>=4.36.2
|
| 32 |
faiss-cpu
|
| 33 |
pytesseract
|
| 34 |
nltk
|