Text Generation
Transformers
Safetensors
PyTorch
English
aro_babylm
causal-lm
custom-code
babylm
babylm-2026
small-language-model
custom_code
Instructions to use AwakeningOS/ARO-BabyLM-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AwakeningOS/ARO-BabyLM-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AwakeningOS/ARO-BabyLM-1B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("AwakeningOS/ARO-BabyLM-1B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AwakeningOS/ARO-BabyLM-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AwakeningOS/ARO-BabyLM-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AwakeningOS/ARO-BabyLM-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AwakeningOS/ARO-BabyLM-1B
- SGLang
How to use AwakeningOS/ARO-BabyLM-1B 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 "AwakeningOS/ARO-BabyLM-1B" \ --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": "AwakeningOS/ARO-BabyLM-1B", "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 "AwakeningOS/ARO-BabyLM-1B" \ --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": "AwakeningOS/ARO-BabyLM-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AwakeningOS/ARO-BabyLM-1B with Docker Model Runner:
docker model run hf.co/AwakeningOS/ARO-BabyLM-1B
Download aro/optim.py from AwakeningOS/ARO-BabyLM-1B: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/AwakeningOS/ARO-BabyLM-1B/resolve/main/aro/optim.py
- Command line
-
hf download hf://AwakeningOS/ARO-BabyLM-1B/aro/optim.py
-
curl -L -o optim.py https://huggingface.co/AwakeningOS/ARO-BabyLM-1B/resolve/main/aro/optim.py
1.51 kB
| from __future__ import annotations | |
| import torch | |
| def parameter_group_name(name: str, parameter: torch.nn.Parameter) -> str: | |
| """Return the frozen AdamW group for one named parameter.""" | |
| if getattr(parameter, "_no_weight_decay", False): | |
| return "no_decay" | |
| if parameter.ndim < 2 or name.endswith("bias"): | |
| return "no_decay" | |
| return "decay" | |
| def optimizer_group_manifest(model) -> dict: | |
| rows = {"decay": [], "no_decay": []} | |
| for name, parameter in model.named_parameters(): | |
| if parameter.requires_grad: | |
| rows[parameter_group_name(name, parameter)].append(name) | |
| return { | |
| group: { | |
| "names": names, | |
| "tensors": len(names), | |
| "parameters": sum(dict(model.named_parameters())[name].numel() for name in names), | |
| } | |
| for group, names in rows.items() | |
| } | |
| def build_adamw(model, lr=1e-3, betas=(0.9, 0.95), eps=1e-8, weight_decay=0.1, fused=True): | |
| decay, no_decay = [], [] | |
| for name, p in model.named_parameters(): | |
| if not p.requires_grad: | |
| continue | |
| if parameter_group_name(name, p) == "no_decay": | |
| no_decay.append(p) | |
| else: | |
| decay.append(p) | |
| groups = [ | |
| {"params": decay, "weight_decay": weight_decay}, | |
| {"params": no_decay, "weight_decay": 0.0}, | |
| ] | |
| kwargs = dict(lr=lr, betas=betas, eps=eps) | |
| if fused and torch.cuda.is_available(): | |
| kwargs["fused"] = True | |
| return torch.optim.AdamW(groups, **kwargs) | |