-
Notifications
You must be signed in to change notification settings - Fork 10
Dynamic indexing initialized #112
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
Conversation
|
This is fantastic, thank you! I've been thinking about how to get this to work. A few questions:
|
|
Thanks for the thoughtful questions @mtblanton! I'm actively working on both aspects — caching and tokenizer flexibility — and will bring up a clean solution for them. The goal is to ensure minimal overhead on first load and make it easy to plug in different tokenizers dynamically per index. Will update you soon with a refined version! |
|
Added Processor Caching
Enhanced Tokenizer Flexibility
|
| # def InfiniGramProcessorFactoryPathParam( | ||
| # index: AvailableInfiniGramIndexId, | ||
| # ) -> InfiniGramProcessor: | ||
| # return indexes[index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # def InfiniGramProcessorFactoryPathParam( | |
| # index: AvailableInfiniGramIndexId, | |
| # ) -> InfiniGramProcessor: | |
| # return indexes[index] |
| otel_span.set_attribute(SpanAttributes.MESSAGING_CLIENT_ID, worker.id) | ||
|
|
||
| infini_gram_index = indexes[AvailableInfiniGramIndexId(index)] | ||
| #infini_gram_index = indexes[AvailableInfiniGramIndexId(index)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #infini_gram_index = indexes[AvailableInfiniGramIndexId(index)] |
| # def __init__(self, index: AvailableInfiniGramIndexId): | ||
| # self.index = index.value | ||
| # index_mapping = index_mappings[index.value] | ||
|
|
||
| # self.tokenizer = index_mapping["tokenizer"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # def __init__(self, index: AvailableInfiniGramIndexId): | |
| # self.index = index.value | |
| # index_mapping = index_mappings[index.value] | |
| # self.tokenizer = index_mapping["tokenizer"] |
| # index_dir=index_mapping["index_dir"], | ||
| # index_dir_diff=index_mapping["index_dir_diff"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # index_dir=index_mapping["index_dir"], | |
| # index_dir_diff=index_mapping["index_dir_diff"], |
|
|
||
|
|
||
| indexes = {index: InfiniGramProcessor(index) for index in AvailableInfiniGramIndexId} | ||
| # indexes = {index: InfiniGramProcessor(index) for index in AvailableInfiniGramIndexId} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # indexes = {index: InfiniGramProcessor(index) for index in AvailableInfiniGramIndexId} |
mtblanton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay in the review! I need to make sure my Github notifs are set up correctly.
I need to test this myself but this is looking great! Suggested changes are just to get rid of commented code.
This PR refactors the indexing system to support dynamic index loading.