From 06f060ea91d4b8d76f2fc868d9397162c3eb9def Mon Sep 17 00:00:00 2001 From: Riccardo Musmeci Date: Fri, 8 Mar 2024 18:05:03 +0100 Subject: [PATCH 1/3] add mlx-image --- packages/tasks/src/model-libraries-snippets.ts | 7 +++++++ packages/tasks/src/model-libraries.ts | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index 14107ee64..ed7b003d5 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -532,6 +532,13 @@ export HF_HUB_ENABLE_HF_TRANS: string[]FER=1 huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} ${model.id}`, ]; +export const mlxim = (model: ModelData): string[] => [ + `pip install mlx-image + +from mlxim.model import create_model +model = create_model(${model.id})`, +]; + export const nemo = (model: ModelData): string[] => { let command: string[] | undefined = undefined; // Resolve the tag to a nemo domain/sub-domain diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index 850e6e771..e37ce187d 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -192,6 +192,15 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { snippets: snippets.mlx, filter: true, }, + "mlxim": { + prettyLabel: "mlxim", + repoName: "mlx-image", + repoUrl: "https://github.com/riccardomusmeci/mlx-image", + docsUrl: "https://huggingface.co/docs/hub/mlxim", + snippets: snippets.mlxim, + filter: false, + countDownloads: { term: { path: "model.safetensors" } } + }, nemo: { prettyLabel: "NeMo", repoName: "NeMo", From c2b660f964865958eb6c65cfc929cd89ba39bd05 Mon Sep 17 00:00:00 2001 From: Riccardo Musmeci Date: Fri, 8 Mar 2024 18:39:43 +0100 Subject: [PATCH 2/3] fix for mlx-image --- packages/tasks/src/model-libraries-snippets.ts | 3 +-- packages/tasks/src/model-libraries.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index ed7b003d5..75ba02031 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -533,9 +533,8 @@ huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} ${model.i ]; export const mlxim = (model: ModelData): string[] => [ - `pip install mlx-image + `from mlxim.model import create_model -from mlxim.model import create_model model = create_model(${model.id})`, ]; diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index e37ce187d..a9a9dae81 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -192,7 +192,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { snippets: snippets.mlx, filter: true, }, - "mlxim": { + mlxim: { prettyLabel: "mlxim", repoName: "mlx-image", repoUrl: "https://github.com/riccardomusmeci/mlx-image", From 41212f8d817361302b7756e71cf30c95023a84c9 Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Mon, 11 Mar 2024 11:09:57 +0100 Subject: [PATCH 3/3] Make linter happy --- packages/tasks/src/model-libraries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index a9a9dae81..3b6794853 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -199,7 +199,7 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { docsUrl: "https://huggingface.co/docs/hub/mlxim", snippets: snippets.mlxim, filter: false, - countDownloads: { term: { path: "model.safetensors" } } + countDownloads: { term: { path: "model.safetensors" } }, }, nemo: { prettyLabel: "NeMo",