You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
I am sure that this is a bug in LangChain rather than my code.
The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
def find_similar_pages(self, query: str, website_id: int,
num_results: int = 5) -> List[Dict[str, Any]]:
"""
Find similar pages for a given query within a specific website.
Returns pages with similarity scores >= 0.4
"""
try:
results = self.vectorstore.similarity_search_with_relevance_scores(
query,
k=num_results,
score_threshold=0.4,
filter={"website_id": website_id},
)
similar_pages = []
for doc, similarity_score in results:
metadata = doc.metadata
similar_pages.append({
"url": metadata["url"],
"title": metadata["title"],
"summary": doc.page_content.split("\n\n")[1],
"query": query,
"similarity": round(similarity_score, 3)
})
logger.debug(f"Found {len(similar_pages)} similar pages for website_id {website_id}")
return similar_pages
except Exception as e:
logger.error(f"Error querying ChromaDB for website_id {website_id}: {str(e)}", exc_info=True)
return []
Error Message and Stack Trace (if applicable)
Description
While performing the similarity search with relevance score i get Segmentation fault (core dumped). I'm using HuggingFaceInferenceAPIEmbeddings to embed documents using sentence-transformers/all-MiniLM-L6-v2
System Info
System Information
OS: Linux
OS Version: #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07)
Python Version: 3.11.11 (main, Mar 17 2025, 23:23:20) [GCC 12.2.0]
I had a very similar issue using DuckDB. It was fixed when i installed pandas. Might work for you as well. See #29933 (and related PRs #30435 & #30445)
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
While performing the similarity search with relevance score i get
Segmentation fault (core dumped)
. I'm using HuggingFaceInferenceAPIEmbeddings to embed documents usingsentence-transformers/all-MiniLM-L6-v2
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: