Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

nkthakur
/
SmolLM2-135M-Instruct-FT-LR

Text Generation
MLX
ONNX
Safetensors
Transformers.js
English
llama
conversational
Model card Files Files and versions
xet
Community

Instructions to use nkthakur/SmolLM2-135M-Instruct-FT-LR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • MLX

    How to use nkthakur/SmolLM2-135M-Instruct-FT-LR with MLX:

    # Make sure mlx-lm is installed
    # pip install --upgrade mlx-lm
    
    # Generate text with mlx-lm
    from mlx_lm import load, generate
    
    model, tokenizer = load("nkthakur/SmolLM2-135M-Instruct-FT-LR")
    
    prompt = "Write a story about Einstein"
    messages = [{"role": "user", "content": prompt}]
    prompt = tokenizer.apply_chat_template(
        messages, add_generation_prompt=True
    )
    
    text = generate(model, tokenizer, prompt=prompt, verbose=True)
  • Transformers.js

    How to use nkthakur/SmolLM2-135M-Instruct-FT-LR with Transformers.js:

    // npm i @huggingface/transformers
    import { pipeline } from '@huggingface/transformers';
    
    // Allocate pipeline
    const pipe = await pipeline('text-generation', 'nkthakur/SmolLM2-135M-Instruct-FT-LR');
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps Settings
  • LM Studio
  • MLX LM

    How to use nkthakur/SmolLM2-135M-Instruct-FT-LR with MLX LM:

    Generate or start a chat session
    # Install MLX LM
    uv tool install mlx-lm
    # Interactive chat REPL
    mlx_lm.chat --model "nkthakur/SmolLM2-135M-Instruct-FT-LR"
    Run an OpenAI-compatible server
    # Install MLX LM
    uv tool install mlx-lm
    # Start the server
    mlx_lm.server --model "nkthakur/SmolLM2-135M-Instruct-FT-LR"
    # Calling the OpenAI-compatible server with curl
    curl -X POST "http://localhost:8000/v1/chat/completions" \
       -H "Content-Type: application/json" \
       --data '{
         "model": "nkthakur/SmolLM2-135M-Instruct-FT-LR",
         "messages": [
           {"role": "user", "content": "Hello"}
         ]
       }'
SmolLM2-135M-Instruct-FT-LR
870 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
nkthakur's picture
nkthakur
Upload folder using huggingface_hub
c939803 verified 12 months ago
  • onnx
    Upload folder using huggingface_hub 12 months ago
  • .DS_Store
    6.15 kB
    Upload folder using huggingface_hub 12 months ago
  • .gitattributes
    1.52 kB
    initial commit 12 months ago
  • README.md
    190 Bytes
    Upload folder using huggingface_hub 12 months ago
  • chat_template.jinja
    368 Bytes
    Upload folder using huggingface_hub 12 months ago
  • config.json
    878 Bytes
    Upload folder using huggingface_hub 12 months ago
  • generation_config.json
    132 Bytes
    Upload folder using huggingface_hub 12 months ago
  • merges.txt
    466 kB
    Upload folder using huggingface_hub 12 months ago
  • model.safetensors
    538 MB
    xet
    Upload folder using huggingface_hub 12 months ago
  • model.safetensors.index.json
    19.5 kB
    Upload folder using huggingface_hub 12 months ago
  • special_tokens_map.json
    655 Bytes
    Upload folder using huggingface_hub 12 months ago
  • tokenizer.json
    3.52 MB
    Upload folder using huggingface_hub 12 months ago
  • tokenizer_config.json
    3.4 kB
    Upload folder using huggingface_hub 12 months ago
  • vocab.json
    801 kB
    Upload folder using huggingface_hub 12 months ago