Skip to content

portalbh/SmolLM2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Local LLM Chat with Hugging Face Transformers

License: MIT Python 3.7+

This repository accompanies the YouTube tutorial demonstrating how to run a local large language model (LLM) using Hugging Face Transformers. The provided Python script implements a complete workflow for chat-style interactions with a locally stored model.

LLM MODEL

πŸ“š Table of Contents

🌟 Features

  • Local Model Loading πŸ”„
    Load pretrained causal language models from local checkpoints
  • Chat Template Formatting πŸ’¬
    Supports conversational message formatting
  • Smart Tokenization πŸ” 
    Includes attention masking and device allocation
  • Controlled Generation πŸŽ›οΈ
    Configurable parameters:
    • Temperature
    • Top-p sampling
    • Max new tokens
  • Cross-Platform Support πŸ’»
    Works on CPU (CUDA supported for GPU acceleration)

πŸ› οΈ Prerequisites

πŸ“₯ Installation

# Clone repository
git clone https://github.com/portalbh/SmolLM2.git
cd SmolLM2

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # Linux/macOS
venv\Scripts\activate    # Windows

# Install dependencies
pip install torch transformers

About

SmolLM2-1.7B-Instruct

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages