Text Generation
Transformers
Safetensors
chipformer
chip-8
emulator
mechanistic-interpretability
compiled-transformer
custom_code
Instructions to use divagr1925/chipformer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use divagr1925/chipformer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="divagr1925/chipformer", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("divagr1925/chipformer", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use divagr1925/chipformer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "divagr1925/chipformer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "divagr1925/chipformer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/divagr1925/chipformer
- SGLang
How to use divagr1925/chipformer with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "divagr1925/chipformer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "divagr1925/chipformer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "divagr1925/chipformer" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "divagr1925/chipformer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use divagr1925/chipformer with Docker Model Runner:
docker model run hf.co/divagr1925/chipformer
Download config.json from divagr1925/chipformer: direct link, hf CLI and curl.
- Browser
- Download file 5.11 kB
-
https://huggingface.co/divagr1925/chipformer/resolve/main/config.json
- Command line
-
hf download hf://divagr1925/chipformer/config.json
-
curl -L -o config.json https://huggingface.co/divagr1925/chipformer/resolve/main/config.json
5.11 kB
| { | |
| "architectures": [ | |
| "ChipformerForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_chipformer.ChipformerConfig", | |
| "AutoModelForCausalLM": "modeling_chipformer.ChipformerForCausalLM" | |
| }, | |
| "model_type": "chipformer", | |
| "d_model": 382, | |
| "vocab_size": 8708, | |
| "beta": 1000.0, | |
| "layers": [ | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 1 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ] | |
| ], | |
| "ffn_units": 2, | |
| "head_names": [ | |
| "write_addr", | |
| "rec_start", | |
| "last_tick" | |
| ] | |
| }, | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 3 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ] | |
| ], | |
| "ffn_units": 91, | |
| "head_names": [ | |
| "PC", | |
| "I", | |
| "SP", | |
| "DT", | |
| "ST", | |
| "RNG", | |
| "V0", | |
| "key0", | |
| "key1", | |
| "key2", | |
| "key3", | |
| "key4", | |
| "key5", | |
| "key6", | |
| "key7", | |
| "key8", | |
| "key9", | |
| "keyA", | |
| "keyB", | |
| "keyC", | |
| "keyD", | |
| "keyE", | |
| "keyF", | |
| "q.shift", | |
| "q.loadstore", | |
| "q.clip", | |
| "q.logic", | |
| "q.jump", | |
| "q.vforder", | |
| "old", | |
| "old.cls" | |
| ] | |
| }, | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 2 | |
| ] | |
| ], | |
| "ffn_units": 16477, | |
| "head_names": [ | |
| "op_hi" | |
| ] | |
| }, | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 2 | |
| ], | |
| [ | |
| 2, | |
| 2 | |
| ] | |
| ], | |
| "ffn_units": 1054, | |
| "head_names": [ | |
| "op_lo", | |
| "stack_top" | |
| ] | |
| }, | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 2 | |
| ] | |
| ], | |
| "ffn_units": 1108, | |
| "head_names": [ | |
| "VX" | |
| ] | |
| }, | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 2 | |
| ] | |
| ], | |
| "ffn_units": 1117, | |
| "head_names": [ | |
| "VY" | |
| ] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 1080, | |
| "head_names": [] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 65, | |
| "head_names": [] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 52, | |
| "head_names": [] | |
| }, | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 26 | |
| ] | |
| ], | |
| "ffn_units": 88, | |
| "head_names": [ | |
| "ctx" | |
| ] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 31, | |
| "head_names": [] | |
| }, | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 2 | |
| ] | |
| ], | |
| "ffn_units": 4, | |
| "head_names": [ | |
| "vread" | |
| ] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 1007, | |
| "head_names": [] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 64, | |
| "head_names": [] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 8, | |
| "head_names": [] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 2, | |
| "head_names": [] | |
| }, | |
| { | |
| "heads": [ | |
| [ | |
| 2, | |
| 2 | |
| ] | |
| ], | |
| "ffn_units": 2, | |
| "head_names": [ | |
| "last_collision" | |
| ] | |
| }, | |
| { | |
| "heads": [], | |
| "ffn_units": 24, | |
| "head_names": [] | |
| } | |
| ], | |
| "machine": { | |
| "VAL_BASE": 0, | |
| "ADDR_BASE": 4096, | |
| "STEP": 8705, | |
| "TICK": 8706, | |
| "BOOT": 8707, | |
| "NUM_CELLS": 4609, | |
| "NULL": 4608, | |
| "CLS": 4118, | |
| "PC": 4113, | |
| "RNG": 4117, | |
| "KEYS": 4144, | |
| "DISPLAY": 4352, | |
| "DISPLAY_W": 64, | |
| "DISPLAY_H": 32, | |
| "PROGRAM_START": 512, | |
| "FONT_BASE": 80, | |
| "RNG_SEED": 2766, | |
| "QUIRKS": 4119, | |
| "FONT": [ | |
| 240, | |
| 144, | |
| 144, | |
| 144, | |
| 240, | |
| 32, | |
| 96, | |
| 32, | |
| 32, | |
| 112, | |
| 240, | |
| 16, | |
| 240, | |
| 128, | |
| 240, | |
| 240, | |
| 16, | |
| 240, | |
| 16, | |
| 240, | |
| 144, | |
| 144, | |
| 240, | |
| 16, | |
| 16, | |
| 240, | |
| 128, | |
| 240, | |
| 16, | |
| 240, | |
| 240, | |
| 128, | |
| 240, | |
| 144, | |
| 240, | |
| 240, | |
| 16, | |
| 32, | |
| 64, | |
| 64, | |
| 240, | |
| 144, | |
| 240, | |
| 144, | |
| 240, | |
| 240, | |
| 144, | |
| 240, | |
| 16, | |
| 240, | |
| 240, | |
| 144, | |
| 240, | |
| 144, | |
| 144, | |
| 224, | |
| 144, | |
| 224, | |
| 144, | |
| 224, | |
| 240, | |
| 128, | |
| 128, | |
| 128, | |
| 240, | |
| 224, | |
| 144, | |
| 144, | |
| 144, | |
| 224, | |
| 240, | |
| 128, | |
| 240, | |
| 128, | |
| 240, | |
| 240, | |
| 128, | |
| 240, | |
| 128, | |
| 128 | |
| ], | |
| "QUIRK_NAMES": [ | |
| "shift", | |
| "loadstore", | |
| "clip", | |
| "logic", | |
| "jump", | |
| "vforder" | |
| ], | |
| "PROFILES": { | |
| "octo": [], | |
| "chip48": [ | |
| "shift", | |
| "loadstore", | |
| "clip" | |
| ], | |
| "cosmac": [ | |
| "logic", | |
| "clip" | |
| ] | |
| } | |
| }, | |
| "max_position": 4194304, | |
| "rollover_at": 250000, | |
| "params": 32328660, | |
| "nonzero_params": 139229, | |
| "dtype": "float64", | |
| "torch_dtype": "float64", | |
| "tie_word_embeddings": false | |
| } |