Spaces:
Sleeping
Sleeping
Debug retriever and search
Browse files- app/config.py +4 -2
- app/services/embeddings.py +1 -1
app/config.py
CHANGED
|
@@ -25,7 +25,9 @@ class Settings:
|
|
| 25 |
HF_TOKEN: str = os.getenv("HF_TOKEN", "")
|
| 26 |
|
| 27 |
# Embedding Model
|
| 28 |
-
EMBEDDING_MODEL: str = os.getenv("EMBEDDING_MODEL", "sentence-transformers/all-MiniLM-L6-v2")
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Server Configuration
|
| 31 |
HOST: str = os.getenv("HOST", "0.0.0.0")
|
|
@@ -37,6 +39,6 @@ class Settings:
|
|
| 37 |
|
| 38 |
# Vector Search
|
| 39 |
TOP_K: int = 5
|
| 40 |
-
SCORE_THRESHOLD: float = 0.
|
| 41 |
|
| 42 |
settings = Settings()
|
|
|
|
| 25 |
HF_TOKEN: str = os.getenv("HF_TOKEN", "")
|
| 26 |
|
| 27 |
# Embedding Model
|
| 28 |
+
#EMBEDDING_MODEL: str = os.getenv("EMBEDDING_MODEL", "sentence-transformers/all-MiniLM-L6-v2")
|
| 29 |
+
#EMBEDDING_MODEL: str = os.getenv("EMBEDDING_MODEL", "sentence-transformers/multi-qa-MiniLM-L6-cos-v1")
|
| 30 |
+
EMBEDDING_MODEL: str = os.getenv("EMBEDDING_MODEL", "BAAI/bge-small-en-v1.5")
|
| 31 |
|
| 32 |
# Server Configuration
|
| 33 |
HOST: str = os.getenv("HOST", "0.0.0.0")
|
|
|
|
| 39 |
|
| 40 |
# Vector Search
|
| 41 |
TOP_K: int = 5
|
| 42 |
+
SCORE_THRESHOLD: float = 0.0
|
| 43 |
|
| 44 |
settings = Settings()
|
app/services/embeddings.py
CHANGED
|
@@ -20,7 +20,7 @@ class EmbeddingService:
|
|
| 20 |
def embed_text(self, text: str) -> List[float]:
|
| 21 |
"""Generate embedding for a single text"""
|
| 22 |
embedding = self.model.encode(text, convert_to_numpy=True, normalize_embeddings=True)
|
| 23 |
-
logger.debug(f"Generated embedding for text: {embedding}")
|
| 24 |
return embedding.tolist()
|
| 25 |
|
| 26 |
|
|
|
|
| 20 |
def embed_text(self, text: str) -> List[float]:
|
| 21 |
"""Generate embedding for a single text"""
|
| 22 |
embedding = self.model.encode(text, convert_to_numpy=True, normalize_embeddings=True)
|
| 23 |
+
#logger.debug(f"Generated embedding for text: {embedding}")
|
| 24 |
return embedding.tolist()
|
| 25 |
|
| 26 |
|