Spaces:
Sleeping
Sleeping
Update app.py (#5)
Browse files- Update app.py (c36c211dd1a549bffa8b9e50c265c4b9480f61ff)
Co-authored-by: Zunaira Hawwar <ZunairaHawwar@users.noreply.huggingface.co>
app.py
CHANGED
|
@@ -671,11 +671,12 @@ GROQ_MODEL = "llama3-8b-8192"
|
|
| 671 |
# Initialize Groq client
|
| 672 |
groq_client = Groq(api_key=GROQ_API_KEY)
|
| 673 |
|
| 674 |
-
#
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
)
|
|
|
|
| 679 |
|
| 680 |
# Initialize ChromaDB Persistent Client
|
| 681 |
chroma_client = chromadb.PersistentClient(path="./chroma_db", settings=Settings(anonymized_telemetry=False))
|
|
|
|
| 671 |
# Initialize Groq client
|
| 672 |
groq_client = Groq(api_key=GROQ_API_KEY)
|
| 673 |
|
| 674 |
+
# Explicitly load SentenceTransformer model first to avoid meta tensor bug
|
| 675 |
+
embedding_model = SentenceTransformer("all-MiniLM-L6-v2")
|
| 676 |
+
|
| 677 |
+
# Pass this model into Chroma's embedding function
|
| 678 |
+
embedding_function = SentenceTransformerEmbeddingFunction(embedding_model=embedding_model)
|
| 679 |
+
|
| 680 |
|
| 681 |
# Initialize ChromaDB Persistent Client
|
| 682 |
chroma_client = chromadb.PersistentClient(path="./chroma_db", settings=Settings(anonymized_telemetry=False))
|