Instructions to use arithmetic-circuit-overloading/gpt2-256D-3L-2H with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arithmetic-circuit-overloading/gpt2-256D-3L-2H with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="arithmetic-circuit-overloading/gpt2-256D-3L-2H")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("arithmetic-circuit-overloading/gpt2-256D-3L-2H") model = AutoModelForCausalLM.from_pretrained("arithmetic-circuit-overloading/gpt2-256D-3L-2H") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use arithmetic-circuit-overloading/gpt2-256D-3L-2H with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "arithmetic-circuit-overloading/gpt2-256D-3L-2H" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "arithmetic-circuit-overloading/gpt2-256D-3L-2H", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/arithmetic-circuit-overloading/gpt2-256D-3L-2H
- SGLang
How to use arithmetic-circuit-overloading/gpt2-256D-3L-2H 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 "arithmetic-circuit-overloading/gpt2-256D-3L-2H" \ --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": "arithmetic-circuit-overloading/gpt2-256D-3L-2H", "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 "arithmetic-circuit-overloading/gpt2-256D-3L-2H" \ --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": "arithmetic-circuit-overloading/gpt2-256D-3L-2H", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use arithmetic-circuit-overloading/gpt2-256D-3L-2H with Docker Model Runner:
docker model run hf.co/arithmetic-circuit-overloading/gpt2-256D-3L-2H
| { | |
| "version": "1.0", | |
| "truncation": null, | |
| "padding": { | |
| "strategy": "BatchLongest", | |
| "direction": "Left", | |
| "pad_to_multiple_of": null, | |
| "pad_id": 0, | |
| "pad_type_id": 0, | |
| "pad_token": "<pad>" | |
| }, | |
| "added_tokens": [ | |
| { | |
| "id": 0, | |
| "content": "<pad>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| { | |
| "id": 1, | |
| "content": "<bos>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| { | |
| "id": 2, | |
| "content": "<eos>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| }, | |
| { | |
| "id": 3, | |
| "content": "<unk>", | |
| "single_word": false, | |
| "lstrip": false, | |
| "rstrip": false, | |
| "normalized": false, | |
| "special": true | |
| } | |
| ], | |
| "normalizer": null, | |
| "pre_tokenizer": { | |
| "type": "Split", | |
| "pattern": { | |
| "Regex": "[\\s\\S]" | |
| }, | |
| "behavior": "Isolated", | |
| "invert": false | |
| }, | |
| "post_processor": { | |
| "type": "TemplateProcessing", | |
| "single": [ | |
| { | |
| "Sequence": { | |
| "id": "A", | |
| "type_id": 0 | |
| } | |
| } | |
| ], | |
| "pair": [ | |
| { | |
| "Sequence": { | |
| "id": "A", | |
| "type_id": 0 | |
| } | |
| }, | |
| { | |
| "Sequence": { | |
| "id": "B", | |
| "type_id": 1 | |
| } | |
| } | |
| ], | |
| "special_tokens": {} | |
| }, | |
| "decoder": { | |
| "type": "Fuse" | |
| }, | |
| "model": { | |
| "type": "WordLevel", | |
| "vocab": { | |
| "<pad>": 0, | |
| "<bos>": 1, | |
| "<eos>": 2, | |
| "<unk>": 3, | |
| "\n": 4, | |
| "*": 5, | |
| "+": 6, | |
| "-": 7, | |
| "/": 8, | |
| "0": 9, | |
| "1": 10, | |
| "2": 11, | |
| "3": 12, | |
| "4": 13, | |
| "5": 14, | |
| "6": 15, | |
| "7": 16, | |
| "8": 17, | |
| "9": 18, | |
| "=": 19 | |
| }, | |
| "unk_token": "<unk>" | |
| } | |
| } |