-
Notifications
You must be signed in to change notification settings - Fork 1.2k
We can have a tokenizer anywhere. #2527
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
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.
Very nice!
router/src/server.rs
Outdated
let tokens: Vec<SimpleToken> = encoding | ||
.get_ids() | ||
.iter() | ||
.zip(encoding.get_offsets()) |
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.
This zip will fail for Python.
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.
I "fixed" it by ignoring offsets if not present.
Python non rust will definitely exist in forms where offsets are not available (ByT5) so I'll assume we cannot have them.
In that case we'll send the raw ids and totally ignore the "text" part (since it doesn't have a good definition without offsets in the original query)
router/src/server.rs
Outdated
let tokens: Vec<SimpleToken> = encoding | ||
.get_ids() | ||
.iter() | ||
.zip(encoding.get_offsets()) |
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.
Same.
0f0e6a7
to
982f474
Compare
e4f8546
to
905731b
Compare
try: | ||
self.embed_tokens = TensorParallelEmbedding(f"{prefix}.embeddings", weights) | ||
except RuntimeError: | ||
self.embed_tokens = TensorParallelEmbedding(f"{prefix}.embedding", weights) |
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.
Confused by this.
Why should it work the second time?
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.
No s
. There's a difference between mamba-hf and mamba ssh here.
8350797
to
bbbd9a6
Compare
What does this PR do?
We can check that it works with
google/byt5-small
for instance (And also deadlocks if multiple validation workers are called since they all fight for the GIL as I've owned the gil in each thread.)Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.