Text Generation
Transformers
Safetensors
PyTorch
cma
custom_code
causal-lm
small-language-model
generalist
4k-tokenizer
Instructions to use User01110/cma-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use User01110/cma-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="User01110/cma-mini", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("User01110/cma-mini", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use User01110/cma-mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "User01110/cma-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-mini", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/User01110/cma-mini
- SGLang
How to use User01110/cma-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-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-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-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-mini", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use User01110/cma-mini with Docker Model Runner:
docker model run hf.co/User01110/cma-mini
| { | |
| "steps": 60000, | |
| "session_steps": 30000, | |
| "session_count": 2, | |
| "batch_size": 256, | |
| "grad_accum": 2, | |
| "seq_len": 1024, | |
| "model_context": 1024, | |
| "d_model": 216, | |
| "n_layers": 10, | |
| "n_heads": 6, | |
| "n_kv_heads": 2, | |
| "chunk": 24, | |
| "cma_heads": 3, | |
| "expand": 2, | |
| "cma_identity_prob": 0.9, | |
| "lr": 0.0025, | |
| "linear_decay_start": 30000, | |
| "cosine_decay_start": 50000, | |
| "mid_lr": 0.0015, | |
| "muon_lr": 0.03, | |
| "muon_momentum": 0.95, | |
| "muon_ns_steps": 5, | |
| "muon_adjust_lr_fn": null, | |
| "warmup": 750, | |
| "wd": 0.01, | |
| "grad_clip": 1.0, | |
| "log_every": 10, | |
| "diag_every": 1000, | |
| "eval_every": 10000, | |
| "val_batch_size": 32, | |
| "val_batches": 0, | |
| "val_context": 1024, | |
| "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": "32", | |
| "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_Mini_lm_eval_hf", | |
| "lm_eval_output_dir": "lm_eval_results_CMA_Mini", | |
| "arithmark3_choice_batch_size": 64, | |
| "arithmark3_force_download": false, | |
| "recipe_version": "CMAMini_Pre_d216_l10_q6_kv2_chunk24_h3_expand2_identity90_train1024_ctx1024_v4k_gpts5m_fullcompile_adam2p5e3_to1p5e3_linear30k50k_cos0_60k_muon3e2_scaled_w750_clip1_31p46B_b256_a2_tpu524k_sessions2x30k_static_fwe55_cos25_fwhq10_math10_interleaved_pinneddata_buf1k_prefetch16_eval1024s512_b32_arithb64_eval10k_diag1k_arithbos_v20", | |
| "hf_repo_id": "User01110/cma-mini", | |
| "hf_repo_private": false, | |
| "hub_upload_retries": 3, | |
| "resume_branch": "resume-latest", | |
| "resume_model_file": "resume_model.safetensors", | |
| "resume_state_file": "resume_state.pt", | |
| "resume_manifest_file": "resume_manifest.json", | |
| "tokenizer_name": "AxiomicLabs/GPT-S-5M", | |
| "tokenizer_revision": "275b9c3ca78736bf6aeb154c7e2d5f5764fe9035", | |
| "data_seed": 1337, | |
| "shuffle_buffer": 1024, | |
| "tokenize_batch_size": 64, | |
| "prefetch_batches": 16, | |
| "compile": true | |
| } |