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

Add model2vec to config.json #134

Closed
davidmezzetti opened this issue Nov 25, 2024 · 6 comments
Closed

Add model2vec to config.json #134

davidmezzetti opened this issue Nov 25, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@davidmezzetti
Copy link

Hello.

I'm planning to add a change to txtai to autodetect model2vec models. The best idea I have right now is the read the config.json file and see if it has the keys apply_pca and apply_zipf.

While I believe this will be pretty unique, have you guys considered adding something to the config.json file to signal it's a model2vec file?

@Pringled
Copy link
Member

Hey @davidmezzetti,

That's a great suggestion! We will add the following to our config.json files:

"model_type": "model2vec",
"architectures": [
    "StaticModel"
  ],

And then you can use the model_type key to check for model2vec models. I'll ping you once we've made that change.

@Pringled Pringled self-assigned this Nov 26, 2024
@Pringled Pringled added the enhancement New feature or request label Nov 26, 2024
@davidmezzetti
Copy link
Author

Sounds great! This will make it easier in my case as txtai is working with multiple vectorization libraries. Once this change is in, txtai will be able to automatically infer the vectorization method for model2vec models.

import txtai
embeddings = txtai.Embeddings(path="minishlab/potion-base-8M")

@Pringled
Copy link
Member

Hey @davidmezzetti, I just updated all our configs to include the changes. Let me know if everything works as intended!

@davidmezzetti
Copy link
Author

Excellent. Looks like this should work. I'll integrate this into txtai and report back. Thank you!

@davidmezzetti
Copy link
Author

This change has been made, thanks again!

Just as an FYI, the potion-science models don't appear to have the updated config. But the other models are all working as expected.

@Pringled
Copy link
Member

Pringled commented Dec 1, 2024

Hey @davidmezzetti, great, no problem! I just updated the science models as well, thanks for pointing that out!

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

No branches or pull requests

2 participants