Instructions to use AjayRangoji/AR-4B-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AjayRangoji/AR-4B-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AjayRangoji/AR-4B-base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("AjayRangoji/AR-4B-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AjayRangoji/AR-4B-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AjayRangoji/AR-4B-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AjayRangoji/AR-4B-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AjayRangoji/AR-4B-base
- SGLang
How to use AjayRangoji/AR-4B-base 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 "AjayRangoji/AR-4B-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AjayRangoji/AR-4B-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "AjayRangoji/AR-4B-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AjayRangoji/AR-4B-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AjayRangoji/AR-4B-base with Docker Model Runner:
docker model run hf.co/AjayRangoji/AR-4B-base
Download training_code/run_args.sh from AjayRangoji/AR-4B-base: direct link, hf CLI and curl.
- Browser
- Download file 2.29 kB
-
https://huggingface.co/AjayRangoji/AR-4B-base/resolve/main/training_code/run_args.sh
- Command line
-
hf download hf://AjayRangoji/AR-4B-base/training_code/run_args.sh
-
curl -L -o run_args.sh https://huggingface.co/AjayRangoji/AR-4B-base/resolve/main/training_code/run_args.sh
2.29 kB
| # Training settings, re-read at every (re)start of the training loop. | |
| # To change them without giving up the nodes: edit this file, then `touch logs/RELOAD`. | |
| BIN="/fsx/ajay-stu/ar-data/bin/fineweb.bin /fsx/ajay-stu/ar-data/bin/fw003/fineweb.bin /fsx/ajay-stu/ar-data/bin/fw004/fineweb.bin /fsx/ajay-stu/ar-data/bin/fw005/fineweb.bin /fsx/ajay-stu/ar-data/bin/fw006/fineweb.bin /fsx/ajay-stu/ar-data/bin/fw007/fineweb.bin /fsx/ajay-stu/ar-data/bin/fw008/fineweb.bin /fsx/ajay-stu/ar-data/bin/fw009/fineweb.bin /fsx/ajay-stu/ar-data/bin/stack_python.bin /fsx/ajay-stu/ar-data/bin/stack_javascript.bin /fsx/ajay-stu/ar-data/bin/stack_java.bin /fsx/ajay-stu/ar-data/bin/stack_cpp.bin /fsx/ajay-stu/ar-data/bin/stack_typescript.bin /fsx/ajay-stu/ar-data/bin/stack_go.bin /fsx/ajay-stu/ar-data/bin/stack_rust.bin /fsx/ajay-stu/ar-data/bin/stack_shell.bin /fsx/ajay-stu/ar-data/bin/stack_sql.bin /fsx/ajay-stu/ar-data/bin/finemath.bin /fsx/ajay-stu/ar-data/bin/finemath3.bin" | |
| WEIGHTS="0.174428 0.067939 0.067939 0.067939 0.067939 0.067939 0.067939 0.067939 0.070791 0.033565 0.033565 0.023975 0.019180 0.004795 0.004795 0.004539 0.004795 0.044444 0.105556" | |
| STOP_AT=619700 | |
| LR_HORIZON=572000 | |
| PEAK_LR=3e-4 | |
| # >>> stage2 (written by s2_prepare.py): Stage 2 switches on by itself at step 572,000 | |
| export STAGE2_START=572000 STAGE2_WARMUP=1000 STAGE2_PEAK=1e-4 STAGE2_MIN=1e-5 | |
| export PROTECT_CKPTS="ckpt_571999" | |
| export S2_BIN="/fsx/ajay-stu/ar-data/stage2/hq010/fineweb_hq.bin /fsx/ajay-stu/ar-data/stage2/hq011/fineweb_hq.bin /fsx/ajay-stu/ar-data/stage2/hq012/fineweb_hq.bin /fsx/ajay-stu/ar-data/stage2/cosmopedia.bin /fsx/ajay-stu/ar-data/bin/stack_python.bin /fsx/ajay-stu/ar-data/bin/stack_javascript.bin /fsx/ajay-stu/ar-data/bin/stack_java.bin /fsx/ajay-stu/ar-data/bin/stack_cpp.bin /fsx/ajay-stu/ar-data/bin/stack_typescript.bin /fsx/ajay-stu/ar-data/bin/stack_go.bin /fsx/ajay-stu/ar-data/bin/stack_rust.bin /fsx/ajay-stu/ar-data/bin/stack_shell.bin /fsx/ajay-stu/ar-data/bin/stack_sql.bin /fsx/ajay-stu/ar-data/bin/finemath.bin /fsx/ajay-stu/ar-data/stage2/infiwebmath.bin /fsx/ajay-stu/ar-data/bin/finemath3.bin" | |
| export S2_WEIGHTS="0.066667 0.066667 0.066667 0.100000 0.106186 0.050347 0.050347 0.035962 0.028770 0.007192 0.007192 0.006809 0.007192 0.160000 0.120000 0.120000" | |
| # <<< stage2 | |