Skip to content

[diffusers-cli] Add a CLI command to run FP16 and safetensors conversions and opening PRs#3982

Merged
sayakpaul merged 3 commits into
mainfrom
feat/conversion-util
Jul 11, 2023
Merged

[diffusers-cli] Add a CLI command to run FP16 and safetensors conversions and opening PRs#3982
sayakpaul merged 3 commits into
mainfrom
feat/conversion-util

Conversation

@sayakpaul

@sayakpaul sayakpaul commented Jul 7, 2023

Copy link
Copy Markdown
Member

This PR introduces a CLI command for converting checkpoints to FP16 and safetensors. And it also provides support for opening PR to the corresponding pipeline repo with the converted checkpoints. This PR is very much inspired from @gante's https://github.com/huggingface/transformers/blob/main/src/transformers/commands/pt_to_tf.py.

I tested with:

diffusers-cli fp16_safetensors --ckpt_id=sayakpaul/shap_e_testing --fp16 --use_safetensors

Resultant PR: https://huggingface.co/sayakpaul/shap_e_testing/discussions/1/

If this is approved I will run the command on SHAP-E repositories of OpenAI and open PRs.

Cc: @yiyixuxu (for Kandinsky 2.2)

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Jul 7, 2023

Copy link
Copy Markdown

The documentation is not available anymore as the PR was closed or merged.

@pcuenca pcuenca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice! My only question is whether this should live in src/diffusers or just moved to scripts with the other utilities.

@sayakpaul

sayakpaul commented Jul 7, 2023

Copy link
Copy Markdown
Member Author

I think it might be better off as a CLI command.

@sayakpaul

Copy link
Copy Markdown
Member Author

@patrickvonplaten happy to also add a little doc. In that case, where should that be added? @pcuenca could I also get your review?

@pcuenca

pcuenca commented Jul 10, 2023

Copy link
Copy Markdown
Member

@patrickvonplaten happy to also add a little doc. In that case, where should that be added? @pcuenca could I also get your review?

I thought about the doc too, but not sure where it should go. Maybe a README somewhere, for now?

@sayakpaul

Copy link
Copy Markdown
Member Author

Hmm, let me just add an usage example in the command source file itself. I think that should cut it for now.

@sayakpaul sayakpaul merged commit f74d5e1 into main Jul 11, 2023
@sayakpaul sayakpaul deleted the feat/conversion-util branch July 11, 2023 03:00
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
…ions and opening PRs (huggingface#3982)

* feat: add a cli util for fp16 and safetensors format.

* fix: commit_description.

* add: usage example.
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
…ions and opening PRs (huggingface#3982)

* feat: add a cli util for fp16 and safetensors format.

* fix: commit_description.

* add: usage example.
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