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
While using SemanticChunking it gives the following error: ValueError: Failed to load embeddings via SentenceTransformerEmbeddings: SentenceTransformer.__init__() got an unexpected keyword argument 'similarity_threshold'
It is due to chonkie library has no similarity_threshold param, instead (I guess) it uses similarity_window.
class SemanticChunking(ChunkingStrategy):
"""Chunking strategy that splits text into semantic chunks using chonkie"""
def __init__(
self, embedder: Optional[Embedder] = None, chunk_size: int = 5000, similarity_threshold: Optional[float] = 0.5
):
self.embedder = embedder or OpenAIEmbedder(model="text-embedding-3-small")
self.chunk_size = chunk_size
self.similarity_threshold = similarity_threshold
self.chunker = SemanticChunker(
embedding_model=self.embedder.model, # type: ignore
chunk_size=self.chunk_size,
similarity_threshold=self.similarity_threshold, # this line gives error
)
The text was updated successfully, but these errors were encountered:
While using SemanticChunking it gives the following error:
ValueError: Failed to load embeddings via SentenceTransformerEmbeddings: SentenceTransformer.__init__() got an unexpected keyword argument 'similarity_threshold'
It is due to chonkie library has no
similarity_threshold
param, instead (I guess) it usessimilarity_window
.The text was updated successfully, but these errors were encountered: