-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add Jina Embedding model #52
Conversation
self._model = None | ||
|
||
def load(self): | ||
self._model = AutoModel.from_pretrained( |
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.
bonus, you can use hf_cache
in the config with these settings so the cold start is fire out of the box.
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.
Added!
environment_variables: {} | ||
external_package_dirs: [] | ||
model_metadata: | ||
example_model_input: {"text": ["I want to eat pasta", "I want to eat pizza"]} |
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.
maybe add the max length to the sample so it's obvious that users can edit it.
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.
awesome! could you also please add this to the ci.yaml? lmk if you need help getting the lint to pass
environment_variables: {} | ||
external_package_dirs: [] | ||
hf_cache: | ||
- repo_id: jinaai/jina-embeddings-v2-base-en |
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.
you probably wanna pin the revision here just like you're doing in the load.
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.
Ah, makes sense, do you know how to do that? Would it just be revision
: abcd1234
?
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.
@bolasim I was having trouble getting the The model is a quarter of a gig, so the download actually only takes about a second (log line below):
The whole model.load() is 8.5 seconds which is not great but not terrible. And the model is running faster now with the new revision, I'm getting 40-45 seconds for my shakespeare dataset. |
Whatever you think is best! |
Add a Truss for Jina embedding model, intending to add to model library today + publish a blog post on this