Skip to content

Commit aeae64e

Browse files
authored
[integration] Add Model2Vec as a library on the Hub (#929)
Hello! ## Pull Request overview * Add Model2Vec as a library on the Hub * Including snippet ## Links * Repository: https://github.com/MinishLab/model2vec * Models: https://huggingface.co/models?library=model2vec ## Details A Sentence Transformers integration is planned. Once released, I'll add a second snippet on how to load the model with Sentence Transformers. - Tom Aarsen
1 parent fae5853 commit aeae64e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,12 @@ export const mlxim = (model: ModelData): string[] => [
951951
model = create_model(${model.id})`,
952952
];
953953

954+
export const model2vec = (model: ModelData): string[] => [
955+
`from model2vec import StaticModel
956+
957+
model = StaticModel.from_pretrained("${model.id}")`,
958+
];
959+
954960
export const nemo = (model: ModelData): string[] => {
955961
let command: string[] | undefined = undefined;
956962
// Resolve the tag to a nemo domain/sub-domain

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
406406
filter: false,
407407
countDownloads: `path:"mlc-chat-config.json"`,
408408
},
409+
model2vec: {
410+
prettyLabel: "Model2Vec",
411+
repoName: "model2vec",
412+
repoUrl: "https://github.com/MinishLab/model2vec",
413+
snippets: snippets.model2vec,
414+
filter: false,
415+
},
409416
moshi: {
410417
prettyLabel: "Moshi",
411418
repoName: "Moshi",

0 commit comments

Comments
 (0)