Add pipeline tag, library name, project page and sample usage
#1
by nielsr HF Staff - opened
12345627 unmodified lines34353637383936 unmodified lines76777879808139 unmodified lines121122123124---license: mit---# Model Card for Distilled Decoding## Model Details27 unmodified lines### Model Sources* Repository: https://huggingface.co/microsoft/distilled_decoding* Paper: https://arxiv.org/abs/2412.17153### Red TeamingOur models generate images based on predefined categories from ImageNet. Some of the ImageNet categories contain sensitive names such as "assault rifle". This test is designed to assess if the model could produce sensitive images from such categories.36 unmodified lines### RecommendationsWhile these models are designed to generate images in one-step, they also support multi-step sampling to enhance image quality. When the one-step sampling quality is not satisfactory, users are recommended to use enable multi-step sampling.## How to Get Started with the ModelPlease see the GitHub repo for instructions: https://github.com/microsoft/distilled_decoding39 unmodified lines## Model Card ContactWe welcome feedback and collaboration from our audience. If you have suggestions, questions, or observe unexpected/offensive behavior in our technology, please contact us at Zinan Lin, zinanlin@microsoft.com.If the team receives reports of undesired behavior or identifies issues independently, we will update this repository with appropriate mitigations.12345678927 unmodified lines3738394041424336 unmodified lines808182838485868788899091929394959697989910010110210310410510610710810939 unmodified lines149150151152---license: mitpipeline_tag: unconditional-image-generationlibrary_name: transformers---# Model Card for Distilled Decoding## Model Details27 unmodified lines### Model Sources* Repository: https://huggingface.co/microsoft/distilled_decoding* Paper: https://arxiv.org/abs/2412.17153* Project Page: https://imagination-research.github.io/distilled-decoding### Red TeamingOur models generate images based on predefined categories from ImageNet. Some of the ImageNet categories contain sensitive names such as "assault rifle". This test is designed to assess if the model could produce sensitive images from such categories.36 unmodified lines### RecommendationsWhile these models are designed to generate images in one-step, they also support multi-step sampling to enhance image quality. When the one-step sampling quality is not satisfactory, users are recommended to use enable multi-step sampling.## Sample UsageYou can use the `transformers` library to load and generate images with the model:```pythonimport torchfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom distilled_decoding.models.modeling_var_dd import VAR_DD# Load DD modelmodel_name = "microsoft/distilled_decoding"model = VAR_DD.from_pretrained("microsoft/distilled_decoding",subfolder="VAR-DD-d16",torch_dtype=torch.float16).cuda()tokenizer = AutoTokenizer.from_pretrained(model_name, subfolder="tokenizer")# Generate ImageNet image (class-conditional)labels = torch.tensor([483]).cuda() # Golden retriever labelgenerated_img = model.generate(labels=labels, num_inference_steps=1)generated_img.save("golden_retriever.png")```## How to Get Started with the ModelPlease see the GitHub repo for instructions: https://github.com/microsoft/distilled_decoding39 unmodified lines## Model Card ContactWe welcome feedback and collaboration from our audience. If you have suggestions, questions, or observe unexpected/offensive behavior in our technology, please contact us at Zinan Lin, zinanlin@microsoft.com.If the team receives reports of undesired behavior or identifies issues independently, we will update this repository with appropriate mitigations.
README.md+29-1