deep-learning-pytorch-huggingface  by philschmid

Tutorials for deep learning with PyTorch and Hugging Face libraries

created 2 years ago
1,254 stars

Top 32.2% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This repository provides a curated collection of tutorials and examples for deep learning practitioners looking to leverage PyTorch and Hugging Face libraries. It covers advanced fine-tuning techniques for large language models (LLMs) and efficient inference strategies, targeting researchers and engineers working with state-of-the-art NLP models.

How It Works

The project demonstrates practical applications of Hugging Face's transformers, datasets, and accelerate libraries, often integrating with DeepSpeed and PyTorch's Fully Sharded Data Parallel (FSDP) for distributed training. It showcases techniques like LoRA, Q-LoRA, DeepSpeed ZeRO, and Flash Attention for efficient fine-tuning of large models, and explores quantization methods like GPTQ for optimized inference.

Quick Start & Requirements

  • Installation typically involves pip install transformers datasets accelerate deepspeed optimum bitsandbytes trl.
  • Requires PyTorch, Python 3.8+, and potentially CUDA-enabled GPUs for efficient training and inference.
  • Specific examples may have additional dependencies like peft or sentence-transformers.
  • Official documentation and examples are available within the repository.

Highlighted Details

  • Comprehensive fine-tuning examples for various LLMs including FLAN-T5, Falcon 180B, and Llama 2.
  • Demonstrations of advanced training techniques like DeepSpeed ZeRO, LoRA, Q-LoRA, and FSDP.
  • Coverage of efficient inference methods such as FP8, GPTQ quantization, and speculative decoding.
  • Tutorials on instruction-tuning, RAG, and RLHF using methods like DPO.

Maintenance & Community

The repository is maintained by Phil Schmid, a prominent figure in the Hugging Face ecosystem. Community interaction and further resources can typically be found through Hugging Face's official channels.

Licensing & Compatibility

The repository's code is generally licensed under the MIT License, allowing for broad use and modification. However, users should verify the licenses of individual models and datasets used in the examples, as they may have their own specific terms.

Limitations & Caveats

Many examples focus on very large models (e.g., Falcon 180B, Llama 2) requiring significant computational resources (multiple high-end GPUs, substantial VRAM) and may be impractical for users without access to such hardware. Some advanced techniques are presented as forward-looking (e.g., "Fine-tune LLMs in 2025").

Health Check
Last commit

5 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
88 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.