Skip to content

Commit ebae78f

Browse files
not-lainWauplin
andauthored
add SwarmFormer (#1156)
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]>
1 parent e39fce2 commit ebae78f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,10 +1183,17 @@ from models.birefnet import BiRefNet
11831183
model = BiRefNet.from_pretrained("${model.id}")`,
11841184
];
11851185

1186+
export const swarmformer = (model: ModelData): string[] => [
1187+
`from swarmformer import SwarmFormerModel
1188+
1189+
model = SwarmFormerModel.from_pretrained("${model.id}", trust_remote_code=True)
1190+
`,
1191+
];
1192+
11861193
export const mlx = (model: ModelData): string[] => [
11871194
`pip install huggingface_hub hf_transfer
11881195
1189-
export HF_HUB_ENABLE_HF_TRANS: string[]FER=1
1196+
export HF_HUB_ENABLE_HF_TRANSFER=1
11901197
huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} ${model.id}`,
11911198
];
11921199

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
752752
filter: true,
753753
countDownloads: `path:"models/default.zip"`,
754754
},
755+
swarmformer: {
756+
prettyLabel: "SwarmFormer",
757+
repoName: "SwarmFormer",
758+
repoUrl: "https://github.com/takara-ai/SwarmFormer",
759+
snippets: snippets.swarmformer,
760+
filter: false,
761+
},
755762
"f5-tts": {
756763
prettyLabel: "F5-TTS",
757764
repoName: "F5-TTS",

0 commit comments

Comments
 (0)