Skip to content

Latest commit

Β 

History

History
82 lines (56 loc) Β· 3.26 KB

File metadata and controls

82 lines (56 loc) Β· 3.26 KB

Markdown

LLM Project - A Comprehensive Large Language Model Toolkit

πŸ‘‹ Welcome! This repository is a comprehensive toolkit for working with Large Language Models (LLMs). It covers a wide range of tasks from pre-training and fine-tuning to reinforcement learning and question answering. Whether you're a beginner learning the ropes or an experienced researcher, you'll find valuable code and resources here.

✨ Features

  • Advanced Fine-tuning: Explore various fine-tuning techniques, including:
    • PEFT (Parameter-Efficient Fine-Tuning): peft_train.py for efficient adaptation of large models.
    • LoRA (Low-Rank Adaptation): torch_train_lora.py for memory-friendly fine-tuning.
    • T5-Specific Tuning: A dedicated module for fine-tuning T5 models.
  • Pre-training Capabilities: Scripts and utilities to pre-train your own LLMs from scratch.
    • Includes data preprocessing (preprocess_data.py, preprocess_tokenizer.py) and model training (train.py).
  • Reinforcement Learning: Implement cutting-edge RL algorithms for LLM alignment.
    • GRPO (Generative Retrospective Policy Optimization): GRPO_train.py for training with RL.
  • Interactive Chat: A chat_demo.py to test and interact with your trained models.
  • Comprehensive Documentation: Includes detailed notes (notes/), and readme.md files in various modules to guide you through the process.
  • Question Answering: A dedicated module for exploring QA applications with LLMs.

πŸ“‚ Project Structure

The repository is organized into several modules, each focusing on a specific aspect of the LLM lifecycle:

πŸš€ Getting Started

To get started with this project, you'll need to have Python and PyTorch installed.

  1. Clone the repository:

    git clone [https://github.com/phbst/LLM.git](https://github.com/phbst/LLM.git)
    cd LLM
  2. Install dependencies: It is recommended to create a virtual environment.

    pip install -r requirements.txt

    (Note: You may need to create a requirements.txt file based on the imports in the Python scripts.)

  3. Explore the modules: Each module has its own readme.md with more specific instructions. Start with the module that interests you the most!

πŸ€– Usage Examples

While detailed instructions are available within each module, here are some general examples of how to run the scripts:

  • Fine-tuning with PEFT:

    python Finetuning_T5/peft_train.py --config config/t5_config.json
  • Pre-training a new model:

    python pretrain/train.py --data_path data/my_dataset.txt --model_config config/model_config.json
  • Training with Reinforcement Learning:

    python RL/GRPO_train.py --model my_finetuned_model --reward_fn my_reward_function
  • Chat with your model:

    python pretrain/chat_demo.py --model_path pretrain/model/

🀝 Contributing

Contributions are welcome! If you have any suggestions, bug reports, or want to add new features, please open an issue or submit a pull request.

πŸ“„ License

This project is open-sourced under the MIT License. See the LICENSE file for more details.


This README was generated with the help of an AI assistant.