Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 1.29 KB

File metadata and controls

56 lines (44 loc) · 1.29 KB

LLM Project Setup

Files Created:

Core Implementation

  • llm.py - Main LLM implementation with training and chat functionality
  • llm_runner.py - Alternative runner with better error handling
  • chat.py - Lightweight chat interface for using pre-trained model

Usage Examples:

1. Training the Model

python llm.py --train

2. Interactive Chat

python llm.py --chat

3. Test Generation

python llm.py --test

4. Using Pre-trained Model

python chat.py

Features:

  • Transformer-based LLM with multi-head attention
  • Memory-mapped file loading for large datasets
  • Interactive chat interface for real-time conversations
  • Error handling and input validation
  • Cross-device compatibility (CPU/GPU/MPS)

Requirements:

  • Python 3.8+
  • torch
  • pickle
  • mmap

Files Needed:

  • vocab.txt - Character vocabulary
  • output/train_split.txt - Training data
  • output/val_split.txt - Validation data

Next Steps:

  1. Ensure all required files exist
  2. Run training if model not already trained
  3. Start interactive chat to test the LLM
  4. Use the lightweight chat interface for quick conversations

The LLM is now ready to use! You can ask any question and it should provide coherent responses based on the training data.