Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

mlx-community
/
gpt2-base-mlx

Text Generation
MLX
Safetensors
English
gpt2
exbert
Model card Files Files and versions
xet
Community

Instructions to use mlx-community/gpt2-base-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • MLX

    How to use mlx-community/gpt2-base-mlx with MLX:

    # Make sure mlx-lm is installed
    # pip install --upgrade mlx-lm
    # if on a CUDA device, also pip install mlx[cuda]
    
    # Generate text with mlx-lm
    from mlx_lm import load, generate
    
    model, tokenizer = load("mlx-community/gpt2-base-mlx")
    
    prompt = "Once upon a time in"
    text = generate(model, tokenizer, prompt=prompt, verbose=True)
  • Notebooks
  • Google Colab
  • Kaggle
  • Local Apps
  • LM Studio
  • MLX LM

    How to use mlx-community/gpt2-base-mlx with MLX LM:

    Generate or start a chat session
    # Install MLX LM
    uv tool install mlx-lm
    # Generate some text
    mlx_lm.generate --model "mlx-community/gpt2-base-mlx" --prompt "Once upon a time"
gpt2-base-mlx
503 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 2 commits
Susant-Achary's picture
Susant-Achary
Add gpt2 base mlx weights
f084698 verified 7 months ago
  • .gitattributes
    1.52 kB
    initial commit 7 months ago
  • README.md
    137 Bytes
    Add gpt2 base mlx weights 7 months ago
  • config.json
    737 Bytes
    Add gpt2 base mlx weights 7 months ago
  • generation_config.json
    124 Bytes
    Add gpt2 base mlx weights 7 months ago
  • merges.txt
    456 kB
    Add gpt2 base mlx weights 7 months ago
  • model.safetensors
    498 MB
    xet
    Add gpt2 base mlx weights 7 months ago
  • model.safetensors.index.json
    8.55 kB
    Add gpt2 base mlx weights 7 months ago
  • special_tokens_map.json
    99 Bytes
    Add gpt2 base mlx weights 7 months ago
  • tokenizer.json
    3.56 MB
    Add gpt2 base mlx weights 7 months ago
  • tokenizer_config.json
    475 Bytes
    Add gpt2 base mlx weights 7 months ago
  • vocab.json
    798 kB
    Add gpt2 base mlx weights 7 months ago