Skip to content

DevKhizerer/Personal-LLM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Personal-LLM

Personal LLM Project README

🚀 Welcome to the Personal LLM project! This repository contains a Jupyter Notebook demonstrating various techniques and methodologies for working with Language Models (LM) using PyTorch and Hugging Face Transformers. Below is a detailed breakdown of the contents and functionalities provided in the notebook.

Project Setup

Dependencies

Ensure you have the following dependencies installed:

  • torch
  • transformers
  • pandas
  • numpy

You can install them using:

pip install torch transformers pandas numpy

Notebook Overview

Data Preparation

  • Loading Data: The notebook includes code snippets for loading and preprocessing text data.
  • Tokenization: Utilizes Hugging Face tokenizers to prepare data for model training.

Model Training

  • Model Initialization: Demonstrates initializing a pre-trained model (T5Model in this case).
  • Training Loop: Contains a detailed training loop for fine-tuning the model on custom data.
  • CUDA Handling: Explicitly sets use_cuda=False to handle CUDA availability issues.

Attention Mechanisms

  • Self-Attention: Explains the self-attention mechanism in detail, including masking techniques for autoregressive models.
  • Attention Visualization: Visualizes attention weights to understand how the model focuses on different parts of the input.

Inference

  • Text Generation: Provides examples of generating text using the fine-tuned model.
  • Placeholder Prompts: Shows how to generate prompts for placeholders using the trained model.

Advanced Techniques

  • Custom Layers: Includes examples of adding custom layers to the model.
  • Loss Functions: Discusses different loss functions and their implementations.

Utilities

  • Data Export: Code snippets for exporting results to CSV and JSON formats.
  • Visualization: Various visualization techniques to understand model performance.

Running the Notebook

  1. Clone the repository:
    git clone https://github.com/yourusername/personal-LLM.git
  2. Navigate to the project directory:
    cd personal-LLM
  3. Open the Jupyter Notebook:
    jupyter notebook personal-LLM.ipynb

Contributions

Feel free to contribute to this project by opening issues or submitting pull requests. Let's build something amazing together! 🌟

License

This project is licensed under the MIT License.

Happy coding! 🎉

About

Make your own LLM (as good as ChatGPT). Perfect introduction to LLM designing

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors