Text Generation
Transformers
Safetensors
English
cma
custom_code
causal-lm
small-language-model
generalist
4k-tokenizer
Instructions to use User01110/CMA-8M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use User01110/CMA-8M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="User01110/CMA-8M", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("User01110/CMA-8M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use User01110/CMA-8M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "User01110/CMA-8M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "User01110/CMA-8M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/User01110/CMA-8M
- SGLang
How to use User01110/CMA-8M 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 "User01110/CMA-8M" \ --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": "User01110/CMA-8M", "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 "User01110/CMA-8M" \ --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": "User01110/CMA-8M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use User01110/CMA-8M with Docker Model Runner:
docker model run hf.co/User01110/CMA-8M
| { | |
| "steps": 40000, | |
| "batch_size": 256, | |
| "grad_accum": 2, | |
| "seq_len": 1024, | |
| "d_model": 288, | |
| "n_layers": 9, | |
| "n_heads": 6, | |
| "n_kv_heads": 2, | |
| "chunk": 24, | |
| "cma_heads": 3, | |
| "expand": 2, | |
| "cma_identity_prob": 0.9, | |
| "lr": 0.0025, | |
| "muon_lr": 0.03, | |
| "muon_momentum": 0.95, | |
| "muon_ns_steps": 5, | |
| "muon_nesterov": true, | |
| "warmup": 750, | |
| "decay_start_frac": 0.85, | |
| "min_lr_ratio": 0.0, | |
| "wd": 0.01, | |
| "grad_clip": 1.0, | |
| "log_every": 5, | |
| "early_eval_step": 1000, | |
| "eval_every": 10000, | |
| "val_batch_size": 32, | |
| "val_batches": 0, | |
| "val_stride": 512, | |
| "infer_tokens": 512, | |
| "infer_repeat_penalty": 1.2, | |
| "infer_prompt": "The process of photosynthesis", | |
| "lm_eval_tasks": "arc_easy,arc_challenge,hellaswag,piqa", | |
| "lm_eval_batch_size": "auto", | |
| "lm_eval_device": "cuda", | |
| "lm_eval_dtype": "float32", | |
| "lm_eval_softmax_dtype": "float32", | |
| "lm_eval_expected_version": "0.4.12", | |
| "lm_eval_retries": 3, | |
| "lm_eval_export_dir": "cma_8m_lm_eval_hf", | |
| "lm_eval_output_dir": "lm_eval_results_cma_8m", | |
| "arithmark_batch_size": 16, | |
| "arithmark_data_path": "benchmark_cache/arithmark_2.0.jsonl", | |
| "arithmark_force_download": false, | |
| "recipe_version": "cma_8m_finemath4plus_v5", | |
| "hf_repo_id": "User01110/cma-8M", | |
| "hf_repo_private": false, | |
| "hub_upload_retries": 3, | |
| "tokenizer_name": "AxiomicLabs/GPT-S-5M", | |
| "tokenizer_revision": "df47402", | |
| "data_seed": 1337, | |
| "shuffle_buffer": 50000, | |
| "tokenize_batch_size": 64, | |
| "compile": true | |
| } |