Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get error for 02-chunkers-async when run from .py file raise NotImplementedError("Subclasses must implement this method") #32

Open
Sandy4321 opened this issue Jan 10, 2025 · 1 comment

Comments

@Sandy4321
Copy link

get error for 02-chunkers-async when run from .py file
https://github.com/aurelio-labs/semantic-chunkers/blob/main/docs/02-chunkers-async.ipynb
when run from .py file

site-packages\semantic_router\encoders\base.py", line 22, in acall
raise NotImplementedError("Subclasses must implement this method")

builtins.NotImplementedError: Subclasses must implement this method

image

chunker = StatisticalChunker(encoder=encoder, max_split_tokens=300)
import asyncio # Required for running async code

async def process_chunks(content):
# Call the chunker asynchronously
chunks_async = await chunker.acall(docs=[content])
return chunks_async

chunks = asyncio.run(process_chunks(content))
q = 0

@Sandy4321
Copy link
Author

I use
from semantic_router.encoders import HuggingFaceEncoder
encoder = HuggingFaceEncoder()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant