Text Generation
Transformers
Safetensors
English
cma
custom_code
causal-lm
small-language-model
base-model
byte-level
Instructions to use User01110/CMA-1M-Mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use User01110/CMA-1M-Mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="User01110/CMA-1M-Mini", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("User01110/CMA-1M-Mini", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use User01110/CMA-1M-Mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "User01110/CMA-1M-Mini" # 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-1M-Mini", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/User01110/CMA-1M-Mini
- SGLang
How to use User01110/CMA-1M-Mini 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-1M-Mini" \ --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-1M-Mini", "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-1M-Mini" \ --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-1M-Mini", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use User01110/CMA-1M-Mini with Docker Model Runner:
docker model run hf.co/User01110/CMA-1M-Mini
| { | |
| "steps": 20000, | |
| "batch_size": 512, | |
| "grad_accum": 4, | |
| "seq_len": 2048, | |
| "eval_seq_len": 2048, | |
| "d_model": 128, | |
| "n_layers": 6, | |
| "n_heads": 4, | |
| "n_kv_heads": 2, | |
| "chunk": 16, | |
| "cma_heads": 2, | |
| "expand": 2, | |
| "cma_identity_prob": 0.9, | |
| "lr": 0.001, | |
| "muon_momentum": 0.95, | |
| "muon_ns_steps": 5, | |
| "muon_adjust_lr_fn": "match_rms_adamw", | |
| "warmup": 500, | |
| "wd": 0.01, | |
| "grad_clip": 5.0, | |
| "log_every": 5, | |
| "early_eval_step": 1000, | |
| "diag_every": 1000, | |
| "eval_every": 2000, | |
| "val_batch_size": 32, | |
| "val_batches": 0, | |
| "val_stride": 1024, | |
| "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": "bfloat16", | |
| "lm_eval_softmax_dtype": "float32", | |
| "lm_eval_expected_version": "0.4.12", | |
| "lm_eval_retries": 3, | |
| "lm_eval_export_dir": "CMA_1M_Mini_lm_eval_hf", | |
| "lm_eval_output_dir": "lm_eval_results_CMA_1M_Mini", | |
| "arithmark_batch_size": 16, | |
| "arithmark_data_path": "benchmark_cache/arithmark_2.0.jsonl", | |
| "arithmark_force_download": false, | |
| "recipe_version": "CMA_1M_mini_byte_c16_h2_e2_muon_w500_cosine20k_b512_ga4_ctx2k_async_v7", | |
| "hf_repo_id": "User01110/CMA-1M-Mini", | |
| "hf_repo_private": false, | |
| "hub_upload_retries": 3, | |
| "tokenizer_name": "local-byte-level", | |
| "tokenizer_revision": "byte-v1", | |
| "data_seed": 1337, | |
| "shuffle_buffer": 50000, | |
| "tokenize_batch_size": 64, | |
| "compile": true | |
| } | |