Skip to content

add phantom to libraries #1411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

add phantom to libraries #1411

wants to merge 3 commits into from

Conversation

merveenoyan
Copy link
Contributor

No description provided.

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! If possible, a code snippet would be 🔥

@merveenoyan
Copy link
Contributor Author

@pcuenca just added, thanks for review ❤️

@@ -727,6 +727,16 @@ model = pe.VisionTransformer.from_config("${model.id}", pretrained=True)`;
return [vision_encoder];
}
};
export const phantom = (model: ModelData): string[] => [
`huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} --local-dir ./${model.id} # in cli
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend making it full pythonic w/ hfh lib + snapshot_download

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines +730 to +739
export const phantom = (model: ModelData): string[] => [
`huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} --local-dir ./${model.id} # in cli
from phantom_wan import WANI2V, configs
wan_i2v = WanI2V(
config=configs.WAN_CONFIGS['i2v-14B'],
checkpoint_dir=./${model.id}
)
video = wan_i2v.generate(text_prompt, image_prompt)
`,
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @Vaibhavs10 re: using snapshot_download directly. Also, no need to download to a local dir IMO (usually better to showcase the shared cache and if user wants to use a local dir, they can always do it themselves)

Suggested change
export const phantom = (model: ModelData): string[] => [
`huggingface-cli download --local-dir ${nameWithoutNamespace(model.id)} --local-dir ./${model.id} # in cli
from phantom_wan import WANI2V, configs
wan_i2v = WanI2V(
config=configs.WAN_CONFIGS['i2v-14B'],
checkpoint_dir=./${model.id}
)
video = wan_i2v.generate(text_prompt, image_prompt)
`,
];
export const phantom = (model: ModelData): string[] => [
`from huggingface_hub import snapshot_download
from phantom_wan import WANI2V, configs
checkpoint_dir = snapshot_download("${model.id}")
wan_i2v = WanI2V(
config=configs.WAN_CONFIGS['i2v-14B'],
checkpoint_dir=checkpoint_dir,
)
video = wan_i2v.generate(text_prompt, image_prompt)`
];

Comment on lines +666 to +667
prettyLabel: "phantom",
repoName: "phantom",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prettyLabel: "phantom",
repoName: "phantom",
prettyLabel: "Phantom",
repoName: "Phantom",

@@ -662,6 +662,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
snippets: snippets.perception_encoder,
countDownloads: `path_extension:"pt"`,
},
phantom: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately phantom is already used by some repos (https://huggingface.co/models?other=phantom) depending on https://github.com/ByungKwanLee/Phantom which is a totally different project.

Would it be possible to define it as phantom-video for instance? In any case, it will require to update the model card metadata in https://huggingface.co/bytedance-research/Phantom before getting this PR merged (with library_name: phantom-video)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or phantom-wan to match the library name in Python?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants