• Stars
    star
    293
  • Rank 138,224 (Top 3 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 1 year ago
  • Updated 13 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open reproduction of MUSE for fast text2image generation.

open-muse

An open-reproduction effortto reproduce the transformer based MUSE model for fast text2image generation.

Goal

This repo is for reproduction of the MUSE model. The goal is to create a simple and scalable repo, to reproduce MUSE and build knowedge about VQ + transformers at scale. We will use deduped LAION-2B + COYO-700M dataset for training.

Project stages:

  1. Setup the codebase and train a class-conditional model on imagenet.
  2. Conduct text2image experiments on CC12M.
  3. Train improved VQGANs models.
  4. Train the full (base-256) model on LAION + COYO.
  5. Train the full (base-512) model on LAION + COYO.

All the artifacts of this project will be uploaded to the openMUSE organization on the huggingface hub.

Usage

Installation

First create a virtual environment and install the repo using:

git clone https://github.com/huggingface/muse
cd muse
pip install -e ".[extra]"

You'll need to install PyTorch and torchvision manually. We are using torch==1.13.1 with CUDA11.7 for training.

For distributed data parallel training we use accelerate library, although this may change in the future. For dataset loading, we use webdataset library. So the dataset should be in the webdataset format.

Models

At the momemnt we support following models:

  • MaskGitTransformer - The main transformer model from the paper.
  • MaskGitVQGAN - The VQGAN model from the maskgit repo.
  • VQGANModel - The VQGAN model from the taming transformers repo.

The models are implemented under muse directory. All models implement the familiar transformers API. So you can use from_pretrained and save_pretrained methods to load and save the models. The model can be saved and loaded from the huggingface hub.

VQGAN example:

import torch
from torchvision import transforms
from PIL import Image
from muse import MaskGitVQGAN

# Load the pre-trained vq model from the hub
vq_model = MaskGitVQGAN.from_pretrained("openMUSE/maskgit-vqgan-imagenet-f16-256")

# encode and decode images using
encode_transform = = transforms.Compose(
    [
        transforms.Resize(256, interpolation=transforms.InterpolationMode.BILINEAR),
        transforms.CenterCrop(256),
        transforms.ToTensor(),
    ]
)
image = Image.open("...") #
pixel_values = encode_transform(image).unsqueeze(0)
image_tokens = vq_model.encode(pixel_values)
rec_image = vq_model.decode(image_tokens)

# Convert to PIL images
rec_image = 2.0 * rec_image - 1.0
rec_image = torch.clamp(rec_image, -1.0, 1.0)
rec_image = (rec_image + 1.0) / 2.0
rec_image *= 255.0
rec_image = rec_image.permute(0, 2, 3, 1).cpu().numpy().astype(np.uint8)
pil_images = [Image.fromarray(image) for image in rec_image]

MaskGitTransformer example for class-conditional generation:

import torch
from muse import MaskGitTransformer, MaskGitVQGAN
from muse.sampling import cosine_schedule

# Load the pre-trained vq model from the hub
vq_model = MaskGitVQGAN.from_pretrained("openMUSE/maskgit-vqgan-imagenet-f16-256")

# Initialize the MaskGitTransformer model
maskgit_model = MaskGitTransformer(
    vocab_size=2025, #(1024 + 1000 + 1 = 2025 -> Vq_tokens + Imagenet class ids + <mask>)
    max_position_embeddings=257, # 256 + 1 for class token
    hidden_size=512,
    num_hidden_layers=8,
    num_attention_heads=8,
    intermediate_size=2048,
    codebook_size=1024,
    num_vq_tokens=256,
    num_classes=1000,
)

# prepare the input batch
images = torch.randn(4, 3, 256, 256)
class_ids = torch.randint(0, 1000, (4,)) # random class ids
# encode the images
image_tokens = vq_model.encode(images)
batch_size, seq_len = image_tokens.shape
# Sample a random timestep for each image
timesteps = torch.rand(batch_size, device=image_tokens.device)
# Sample a random mask probability for each image using timestep and cosine schedule
mask_prob = cosine_schedule(timesteps)
mask_prob = mask_prob.clip(min_masking_rate)
# creat a random mask for each image
num_token_masked = (seq_len * mask_prob).round().clamp(min=1)
batch_randperm = torch.rand(batch_size, seq_len, device=image_tokens.device).argsort(dim=-1)
mask = batch_randperm < num_token_masked.unsqueeze(-1)
# mask images and create input and labels
input_ids = torch.where(mask, mask_id, image_tokens)
labels = torch.where(mask, image_tokens, -100)

# shift the class ids by codebook size
class_ids = class_ids + vq_model.num_embeddings
# prepend the class ids to the image tokens
input_ids = torch.cat([class_ids.unsqueeze(-1), input_ids], dim=-1)
# prepend -100 to the labels as we don't want to predict the class ids
labels = torch.cat([-100 * torch.ones_like(class_ids).unsqueeze(-1), labels], dim=-1)

# forward pass
logits, loss = maskgit_model(input_ids, labels=labels)

loss.backward()

# to generate images
class_ids = torch.randint(0, 1000, (4,)) # random class ids
generated_tokens = maskgit_model.generate(class_ids=class_ids)
rec_images = vq_model.decode(generated_tokens)

Note:

  • The vq model and transformer model are kept separate to be able to scale the transformer model independently. And we may pre-encode the images for faster training.
  • The masking is also done outside the model to be able to use different masking strategies without affecting the modeling code.

Basic explanation of MaskGit Generation Process

  1. Maskgits is a transformer that outputs logits given a sequence of tokens of both vq and class-conditioned label token

  2. The way the denoising process is done is to mask out with mask token ids and gradually denoise

  3. In the original implementation, this is done by first using a softmax on the last dim and randomly sampling as a categorical distribution. This will give our predicted tokens for each maskid. Then we get the probabilities for those tokens to be chosen. Finally, we get the topk highest confidence probabilities when gumbel*temp is added to it. Gumbel distribution is like a shifted normal distribution towards 0 which is used to model extreme events. So in extreme scenarios, we will like to see a different token being chosen from the default one

  4. For the lucidrian implementation, it first removes the highest-scoring (lowest probability) tokens by masking them with a given masking ratio. Then, except for the highest 10% of the logits that we get, we set it to -infinity so when we do the gumbel distribution on it, they will be ignored. Then update the input ids and the scores where the scores are just 1-the probability given by the softmax of the logits at the predicted ids interestingly

Training

For class-conditional imagenet we are using accelerate for DDP training and webdataset for data loading. The training script is available in training/train_maskgit_imagenet.py.

We use OmegaConf for configuration management. See configs/template_config.yaml for the configuration template. Below we explain the configuration parameters.

wandb:
  entity: ???

experiment:
    name: ???
    project: ???
    output_dir: ???
    max_train_examples: ???
    save_every: 1000
    eval_every: 500
    generate_every: 1000
    log_every: 50
    log_grad_norm_every: 100
    resume_from_checkpoint: latest

model:
    vq_model:
        pretrained: "openMUSE/maskgit-vqgan-imagenet-f16-256"

    transformer:
        vocab_size: 2048 # (1024 + 1000 + 1 = 2025 -> Vq + Imagenet + <mask>, use 2048 for even division by 8)
        max_position_embeddings: 264 # (256 + 1 for class id, use 264 for even division by 8)
        hidden_size: 768
        num_hidden_layers: 12
        num_attention_heads: 12
        intermediate_size: 3072
        codebook_size: 1024
        num_vq_tokens: 256
        num_classes: 1000
        initializer_range: 0.02
        layer_norm_eps: 1e-6
        use_bias: False
        use_normformer: True
        use_encoder_layernorm: True
        hidden_dropout: 0.0
        attention_dropout: 0.0

    gradient_checkpointing: True
    enable_xformers_memory_efficient_attention: False


dataset:
    params:
        train_shards_path_or_url: ???
        eval_shards_path_or_url: ???
        batch_size: ${training.batch_size}
        shuffle_buffer_size: ???
        num_workers: ???
        resolution: 256
        pin_memory: True
        persistent_workers: True
    preprocessing:
        resolution: 256
        center_crop: True
        random_flip: False

optimizer:
    name: adamw # Can be adamw or lion or fused_adamw. Install apex for fused_adamw
    params: # default adamw params
        learning_rate: ???
        scale_lr: False # scale learning rate by total batch size
        beta1: 0.9
        beta2: 0.999
        weight_decay: 0.01
        epsilon: 1e-8

lr_scheduler:
    scheduler: "constant_with_warmup"
    params:
        learning_rate: ${optimizer.params.learning_rate}
        warmup_steps: 500

training:
    gradient_accumulation_steps: 1
    batch_size: 128
    mixed_precision: "no"
    enable_tf32: True
    use_ema: False
    seed: 42
    max_train_steps: ???
    overfit_one_batch: False
    min_masking_rate: 0.0
    label_smoothing: 0.0
    max_grad_norm: null

Arguments with ??? are required.

wandb:

  • wandb.entity: The wandb entity to use for logging.

experiment:

  • experiment.name: The name of the experiment.
  • experiment.project: The wandb project to use for logging.
  • experiment.output_dir: The directory to save the checkpoints.
  • experiment.max_train_examples: The maximum number of training examples to use.
  • experiment.save_every: Save a checkpoint every save_every steps.
  • experiment.eval_every: Evaluate the model every eval_every steps.
  • experiment.generate_every: Generate images every generate_every steps.
  • experiment.log_every: Log the training metrics every log_every steps.
  • log_grad_norm_every: Log the gradient norm every log_grad_norm_every steps.
  • experiment.resume_from_checkpoint: The checkpoint to resume training from. Can be latest to resume from the latest checkpoint or path to a saved checkpoint. If None or the path does not exist then training starts from scratch.

model:

  • model.vq_model.pretrained: The pretrained vq model to use. Can be a path to a saved checkpoint or a huggingface model name.
  • model.transformer: The transformer model configuration.
  • model.gradient_checkpointing: Enable gradient checkpointing for the transformer model.
  • enable_xformers_memory_efficient_attention: Enable memory efficient attention or flash attention for the transformer model. For flash attention we need to use fp16 or bf16. xformers needs to be installed for this to work.

dataset:

  • dataset.params.train_shards_path_or_url: The path or url to the webdataset training shards.
  • dataset.params.eval_shards_path_or_url: The path or url to the webdataset evaluation shards.
  • dataset.params.batch_size: The batch size to use for training.
  • dataset.params.shuffle_buffer_size: The shuffle buffer size to use for training.
  • dataset.params.num_workers: The number of workers to use for data loading.
  • dataset.params.resolution: The resolution of the images to use for training.
  • dataset.params.pin_memory: Pin the memory for data loading.
  • dataset.params.persistent_workers: Use persistent workers for data loading.
  • dataset.preprocessing.resolution: The resolution of the images to use for preprocessing.
  • dataset.preprocessing.center_crop: Whether to center crop the images. If False then the images are randomly cropped to the resolution.
  • dataset.preprocessing.random_flip: Whether to randomly flip the images. If False then the images are not flipped.

optimizer:

  • optimizer.name: The optimizer to use for training.
  • optimizer.params: The optimizer parameters.

lr_scheduler:

  • lr_scheduler.scheduler: The learning rate scheduler to use for training.
  • lr_scheduler.params: The learning rate scheduler parameters.

training:

  • training.gradient_accumulation_steps: The number of gradient accumulation steps to use for training.
  • training.batch_size: The batch size to use for training.
  • training.mixed_precision: The mixed precision mode to use for training. Can be no, fp16 or bf16.
  • training.enable_tf32: Enable TF32 for training on Ampere GPUs.
  • training.use_ema: Enable EMA for training. Currently not supported.
  • training.seed: The seed to use for training.
  • training.max_train_steps: The maximum number of training steps.
  • training.overfit_one_batch: Whether to overfit one batch for debugging.
  • training.min_masking_rate: The minimum masking rate to use for training.
  • training.label_smoothing: The label smoothing value to use for training.
  • max_grad_norm: Max gradient norm.

Notes about training and dataset.:

We randomly resample the shards (with replacement) and sample examples in buffer for training every time we resume/start the training run. This means our data loading is not determinitsic. We also don't do epoch based training but just using this for book keeping and being able to reuse the same training loop with other datasets/loaders.

Running experiments:

So far we are running experiments on single node. To launch a training run on a single node, run the following steps:

  1. Prepare the dataset in webdataset format. You can use the scripts/convert_imagenet_to_wds.py script to convert the imagenet dataset to webdataset format.
  2. First configure your training env using accelerate config.
  3. Create a config.yaml file for your experiment.
  4. Launch the training run using accelerate launch.
accelerate launch python -u training/train_maskgit_imagenet.py config=path/to/yaml/config

With OmegaConf, commandline overrides are done in dot-notation format. E.g. if you want to override the dataset path, you would use the command python -u train.py config=path/to/config dataset.params.path=path/to/dataset.

The same command can be used to launch the training locally.

Steps

Setup the codebase and train a class-conditional model no imagenet.

  • Setup repo-structure
  • Add transformers and VQGAN model.
  • Add a generation support for the model.
  • Port the VQGAN from maskgit repo for imagenet experiment.
  • Finish and verify masking utils.
  • Add the masking arccos scheduling function from MUSE.
  • Add EMA.
  • Suport OmegaConf for training configuration.
  • Add W&B logging utils.
  • Add WebDataset support. Not really needed for imagenet experiment but can work on this parallelly. (LAION is already available in this format so will be easier to use it).
  • Add a training script for class conditional generation using imagenet.
  • Make the codebase ready for the cluster training. Add SLURM scripts.

Conduct text2image experiments on CC12M.

  • Finish data loading, pre-processing utils.
  • Add CLIP and T5 support.
  • Add text2image training script.
  • Add eavluation scripts (FiD, CLIP score).
  • Train on CC12M. Here we could conduct different experiments:
    • Train on CC12M with T5 conditioning.
    • Train on CC12M with CLIP conditioning.
    • Train on CC12M with CLIP + T5 conditioning (probably costly during training and experiments).
    • Self conditioning from Bit Diffusion paper.
  • Collect different prompts for intermmediate evaluations (Can reuse the prompts for dalle-mini, parti-prompts).
  • Setup a space where people can play with the model and provide feedback, compare with other models etc.

Train improved VQGANs models.

  • Add training component models for VQGAN (EMA, discriminator, LPIPS etc).
  • VGQAN training script.

Misc tasks

  • Create a space for visualizing exploring dataset
  • Create a space where people can try to find their own images and can opt-out of the dataset.

Repo structure (WIP)

โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ configs                        -> All training config files.
โ”‚   โ””โ”€โ”€ template_config.yaml
โ”œโ”€โ”€ muse
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ data.py                    -> All data related utils. Can create a data folder if needed.
โ”‚   โ”œโ”€โ”€ logging.py                 -> Misc logging utils.
|   โ”œโ”€โ”€ lr_schedulers.py           -> All lr scheduler related utils.
โ”‚   โ”œโ”€โ”€ modeling_maskgit_vqgan.py  -> VQGAN model from maskgit repo.
โ”‚   โ”œโ”€โ”€ modeling_taming_vqgan.py   -> VQGAN model from taming repo.
โ”‚   โ””โ”€โ”€ modeling_transformer.py    -> The main transformer model.
โ”‚   โ”œโ”€โ”€ modeling_utils.py          -> All model related utils, like save_pretrained, from_pretrained from hub etc
โ”‚   โ”œโ”€โ”€ sampling.py                -> Sampling/Generation utils.
โ”‚   โ”œโ”€โ”€ training_utils.py          -> Common training utils.
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ setup.cfg
โ”œโ”€โ”€ setup.py
โ”œโ”€โ”€ test.py
โ””โ”€โ”€ training                       -> All training scripts.
    โ”œโ”€โ”€ __init__.py
    โ”œโ”€โ”€ data.py                    -> All data related utils. Can create a data folder if needed.
    โ”œโ”€โ”€ optimizer.py               -> All optimizer related utils and any new optimizer not available in PT.
    โ”œโ”€โ”€ train_maskgit_imagenet.py
    โ”œโ”€โ”€ train_muse.py
    โ””โ”€โ”€ train_vqgan.py

Acknowledgments

This project is hevily based on the following open-source repos. Thanks to all the authors for their amazing work.

And obivioulsy to PyTorch team for this amazing framework โค๏ธ

More Repositories

1

transformers

๐Ÿค— Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
Python
126,555
star
2

pytorch-image-models

PyTorch image models, scripts, pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNet-V3/V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more
Python
28,073
star
3

diffusers

๐Ÿค— Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
Python
23,282
star
4

datasets

๐Ÿค— The largest hub of ready-to-use datasets for ML models with fast, easy-to-use and efficient data manipulation tools
Python
17,530
star
5

peft

๐Ÿค— PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.
Python
14,585
star
6

candle

Minimalist ML framework for Rust
Rust
14,045
star
7

tokenizers

๐Ÿ’ฅ Fast State-of-the-Art Tokenizers optimized for Research and Production
Rust
8,560
star
8

text-generation-inference

Large Language Model Text Generation Inference
Python
8,197
star
9

trl

Train transformer language models with reinforcement learning.
Python
8,181
star
10

accelerate

๐Ÿš€ A simple way to launch, train, and use PyTorch models on almost any device and distributed configuration, automatic mixed precision (including fp8), and easy-to-configure FSDP and DeepSpeed support
Python
7,121
star
11

chat-ui

Open source codebase powering the HuggingChat app
TypeScript
6,584
star
12

alignment-handbook

Robust recipes to align language models with human and AI preferences
Python
4,079
star
13

deep-rl-class

This repo contains the syllabus of the Hugging Face Deep Reinforcement Learning Course.
MDX
3,680
star
14

lerobot

๐Ÿค— LeRobot: End-to-end Learning for Real-World Robotics in Pytorch
Python
3,558
star
15

notebooks

Notebooks using the Hugging Face libraries ๐Ÿค—
Jupyter Notebook
3,329
star
16

distil-whisper

Distilled variant of Whisper for speech recognition. 6x faster, 50% smaller, within 1% word error rate.
Python
3,286
star
17

autotrain-advanced

๐Ÿค— AutoTrain Advanced
Python
3,283
star
18

diffusion-models-class

Materials for the Hugging Face Diffusion Models Course
Jupyter Notebook
3,280
star
19

neuralcoref

โœจFast Coreference Resolution in spaCy with Neural Networks
C
2,819
star
20

parler-tts

Inference and training library for high-quality TTS models.
Python
2,735
star
21

knockknock

๐ŸšชโœŠKnock Knock: Get notified when your training ends with only two additional lines of code
Python
2,682
star
22

safetensors

Simple, safe way to store and distribute tensors
Python
2,538
star
23

swift-coreml-diffusers

Swift app demonstrating Core ML Stable Diffusion
Swift
2,406
star
24

text-embeddings-inference

A blazing fast inference solution for text embeddings models
Rust
2,148
star
25

optimum

๐Ÿš€ Accelerate training and inference of ๐Ÿค— Transformers and ๐Ÿค— Diffusers with easy to use hardware optimization tools
Python
2,086
star
26

setfit

Efficient few-shot learning with Sentence Transformers
Jupyter Notebook
2,044
star
27

course

The Hugging Face course on Transformers
MDX
2,005
star
28

awesome-papers

Papers & presentation materials from Hugging Face's internal science day
1,996
star
29

blog

Public repo for HF blog posts
Jupyter Notebook
1,962
star
30

evaluate

๐Ÿค— Evaluate: A library for easily evaluating machine learning models and datasets.
Python
1,825
star
31

transfer-learning-conv-ai

๐Ÿฆ„ State-of-the-Art Conversational AI with Transfer Learning
Python
1,654
star
32

datatrove

Freeing data processing from scripting madness by providing a set of platform-agnostic customizable pipeline processing blocks.
Python
1,635
star
33

swift-coreml-transformers

Swift Core ML 3 implementations of GPT-2, DistilGPT-2, BERT, and DistilBERT for Question answering. Other Transformers coming soon!
Swift
1,543
star
34

pytorch-openai-transformer-lm

๐ŸฅA PyTorch implementation of OpenAI's finetuned transformer language model with a script to import the weights pre-trained by OpenAI
Python
1,464
star
35

cookbook

Open-source AI cookbook
Jupyter Notebook
1,416
star
36

huggingface_hub

All the open source things related to the Hugging Face Hub.
Python
1,311
star
37

Mongoku

๐Ÿ”ฅThe Web-scale GUI for MongoDB
TypeScript
1,289
star
38

huggingface.js

Utilities to use the Hugging Face Hub API
TypeScript
1,251
star
39

gsplat.js

JavaScript Gaussian Splatting library.
TypeScript
1,233
star
40

hmtl

๐ŸŒŠHMTL: Hierarchical Multi-Task Learning - A State-of-the-Art neural network model for several NLP tasks based on PyTorch and AllenNLP
Python
1,185
star
41

llm-vscode

LLM powered development for VSCode
TypeScript
1,148
star
42

pytorch-pretrained-BigGAN

๐Ÿฆ‹A PyTorch implementation of BigGAN with pretrained weights and conversion scripts.
Python
986
star
43

nanotron

Minimalistic large language model 3D-parallelism training
Python
897
star
44

torchMoji

๐Ÿ˜‡A pyTorch implementation of the DeepMoji model: state-of-the-art deep learning model for analyzing sentiment, emotion, sarcasm etc
Python
880
star
45

optimum-nvidia

Python
825
star
46

awesome-huggingface

๐Ÿค— A list of wonderful open-source projects & applications integrated with Hugging Face libraries.
821
star
47

naacl_transfer_learning_tutorial

Repository of code for the tutorial on Transfer Learning in NLP held at NAACL 2019 in Minneapolis, MN, USA
Python
718
star
48

dataset-viewer

Lightweight web API for visualizing and exploring any dataset - computer vision, speech, text, and tabular - stored on the Hugging Face Hub
Python
630
star
49

optimum-quanto

A pytorch quantization backend for optimum
Python
616
star
50

llm.nvim

LLM powered development for Neovim
Lua
590
star
51

exporters

Export Hugging Face models to Core ML and TensorFlow Lite
Python
559
star
52

transformers-bloom-inference

Fast Inference Solutions for BLOOM
Python
550
star
53

pytorch_block_sparse

Fast Block Sparse Matrices for Pytorch
C++
523
star
54

swift-transformers

Swift Package to implement a transformers-like API in Swift
Swift
504
star
55

llm-ls

LSP server leveraging LLMs for code completion (and more?)
Rust
498
star
56

node-question-answering

Fast and production-ready question answering in Node.js
TypeScript
459
star
57

large_language_model_training_playbook

An open collection of implementation tips, tricks and resources for training large language models
Python
441
star
58

lighteval

LightEval is a lightweight LLM evaluation suite that Hugging Face has been using internally with the recently released LLM data processing library datatrove and LLM training library nanotron.
Python
440
star
59

llm_training_handbook

An open collection of methodologies to help with successful training of large language models.
Python
416
star
60

swift-chat

Mac app to demonstrate swift-transformers
Swift
392
star
61

ratchet

A cross-platform browser ML framework.
Rust
390
star
62

tflite-android-transformers

DistilBERT / GPT-2 for on-device inference thanks to TensorFlow Lite with Android demo apps
Java
368
star
63

community-events

Place where folks can contribute to ๐Ÿค— community events
Jupyter Notebook
368
star
64

text-clustering

Easily embed, cluster and semantically label text datasets
Python
367
star
65

nn_pruning

Prune a model while finetuning or training.
Jupyter Notebook
360
star
66

optimum-intel

๐Ÿค— Optimum Intel: Accelerate inference with Intel optimization tools
Jupyter Notebook
342
star
67

speechbox

Python
339
star
68

controlnet_aux

Python
326
star
69

100-times-faster-nlp

๐Ÿš€100 Times Faster Natural Language Processing in Python - iPython notebook
HTML
325
star
70

education-toolkit

Educational materials for universities
Jupyter Notebook
320
star
71

unity-api

C#
302
star
72

datablations

Scaling Data-Constrained Language Models
Jupyter Notebook
296
star
73

audio-transformers-course

The Hugging Face Course on Transformers for Audio
MDX
280
star
74

cosmopedia

Python
280
star
75

hf_transfer

Rust
238
star
76

hub-docs

Docs of the Hugging Face Hub
221
star
77

dataspeech

Python
207
star
78

optimum-benchmark

A unified multi-backend utility for benchmarking Transformers, Timm, PEFT, Diffusers and Sentence-Transformers with full support of Optimum's hardware optimizations & quantization schemes.
Python
206
star
79

diarizers

Python
206
star
80

simulate

๐ŸŽข Creating and sharing simulation environments for embodied and synthetic data research
Python
185
star
81

instruction-tuned-sd

Code for instruction-tuning Stable Diffusion.
Python
181
star
82

llm-swarm

Manage scalable open LLM inference endpoints in Slurm clusters
Python
176
star
83

optimum-neuron

Easy, fast and very cheap training and inference on AWS Trainium and Inferentia chips.
Jupyter Notebook
173
star
84

olm-datasets

Pipeline for pulling and processing online language model pretraining data from the web
Python
169
star
85

data-is-better-together

Let's build better datasets, together!
Jupyter Notebook
162
star
86

OBELICS

Code used for the creation of OBELICS, an open, massive and curated collection of interleaved image-text web documents, containing 141M documents, 115B text tokens and 353M images.
Python
159
star
87

diffusion-fast

Faster generation with text-to-image diffusion models.
Python
157
star
88

workshops

Materials for workshops on the Hugging Face ecosystem
Jupyter Notebook
146
star
89

api-inference-community

Python
145
star
90

jat

Distributed online training of a general multi-task Deep RL Agent
Python
136
star
91

chug

Minimal sharded dataset loaders, decoders, and utils for multi-modal document, image, and text datasets.
Python
136
star
92

sharp-transformers

A Unity plugin for using Transformers models in Unity.
C#
129
star
93

optimum-habana

Easy and lightning fast training of ๐Ÿค— Transformers on Habana Gaudi processor (HPU)
Python
114
star
94

hf-hub

Rust client for the huggingface hub aiming for minimal subset of features over `huggingface-hub` python package
Rust
109
star
95

frp

FRP Fork
Go
102
star
96

competitions

Python
101
star
97

olm-training

Repo for training MLMs, CLMs, or T5-type models on the OLM pretraining data, but it should work with any hugging face text dataset.
Python
92
star
98

fuego

[WIP] A ๐Ÿ”ฅ interface for running code in the cloud
Python
85
star
99

tune

Python
83
star
100

datasets-viewer

Viewer for the ๐Ÿค— datasets library.
Python
83
star