diff --git a/packages/tasks/src/model-libraries-snippets.ts b/packages/tasks/src/model-libraries-snippets.ts index d180658810..a2b48df82f 100644 --- a/packages/tasks/src/model-libraries-snippets.ts +++ b/packages/tasks/src/model-libraries-snippets.ts @@ -1408,6 +1408,19 @@ model = SwarmFormerModel.from_pretrained("${model.id}") `, ]; +export const univa = (model: ModelData): string[] => [ + `# Follow installation instructions at https://github.com/PKU-YuanGroup/UniWorld-V1 + +from univa.models.qwen2p5vl.modeling_univa_qwen2p5vl import UnivaQwen2p5VLForConditionalGeneration + model = UnivaQwen2p5VLForConditionalGeneration.from_pretrained( + "${model.id}", + torch_dtype=torch.bfloat16, + attn_implementation="flash_attention_2", + ).to("cuda") + processor = AutoProcessor.from_pretrained("${model.id}") +`, +]; + const mlx_unknown = (model: ModelData): string[] => [ `# Download the model from the Hub pip install huggingface_hub[hf_xet] diff --git a/packages/tasks/src/model-libraries.ts b/packages/tasks/src/model-libraries.ts index 867b0a0f8f..949ff0ef9e 100644 --- a/packages/tasks/src/model-libraries.ts +++ b/packages/tasks/src/model-libraries.ts @@ -1027,6 +1027,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = { countDownloads: `path_extension:"pt"`, snippets: snippets.ultralytics, }, + univa: { + prettyLabel: "univa", + repoName: "univa", + repoUrl: "https://github.com/PKU-YuanGroup/UniWorld-V1", + snippets: snippets.univa, + filter: true, + countDownloads: `path:"config.json"`, + }, "uni-3dar": { prettyLabel: "Uni-3DAR", repoName: "Uni-3DAR",