Skip to content

Commit

Permalink
add SwarmFormer (#1156)
Browse files Browse the repository at this point in the history
This Pr will add SwarmFormer as well as its associated code snippet to
the supported libraries on the hub.

---------

Co-authored-by: Lucain <[email protected]>
  • Loading branch information
not-lain and Wauplin authored Jan 31, 2025
1 parent e39fce2 commit ebae78f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1183,10 +1183,17 @@ from models.birefnet import BiRefNet
model = BiRefNet.from_pretrained("${model.id}")`,
];

export const swarmformer = (model: ModelData): string[] => [
`from swarmformer import SwarmFormerModel
model = SwarmFormerModel.from_pretrained("${model.id}", trust_remote_code=True)
`,
];

export const mlx = (model: ModelData): string[] => [
`pip install huggingface_hub hf_transfer
export HF_HUB_ENABLE_HF_TRANS: string[]FER=1
export HF_HUB_ENABLE_HF_TRANSFER=1
huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} ${model.id}`,
];

Expand Down
7 changes: 7 additions & 0 deletions packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
filter: true,
countDownloads: `path:"models/default.zip"`,
},
swarmformer: {
prettyLabel: "SwarmFormer",
repoName: "SwarmFormer",
repoUrl: "https://github.com/takara-ai/SwarmFormer",
snippets: snippets.swarmformer,
filter: false,
},
"f5-tts": {
prettyLabel: "F5-TTS",
repoName: "F5-TTS",
Expand Down

0 comments on commit ebae78f

Please sign in to comment.