Instructions to use hf-internal-testing/tiny-axk2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-axk2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-axk2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-axk2") model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-axk2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hf-internal-testing/tiny-axk2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hf-internal-testing/tiny-axk2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hf-internal-testing/tiny-axk2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-axk2
- SGLang
How to use hf-internal-testing/tiny-axk2 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 "hf-internal-testing/tiny-axk2" \ --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": "hf-internal-testing/tiny-axk2", "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 "hf-internal-testing/tiny-axk2" \ --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": "hf-internal-testing/tiny-axk2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/tiny-axk2 with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-axk2
| { | |
| "architectures": [ | |
| "AXK2ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "attention_output_gate": true, | |
| "attn_gate_fused": true, | |
| "aux_loss_alpha": 0.001, | |
| "bos_token_id": 163691, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 163704, | |
| "ep_size": 2, | |
| "gated_norm": true, | |
| "gated_norm_rank": 16, | |
| "head_dim": 64, | |
| "hidden_act": "silu", | |
| "hidden_size": 7168, | |
| "index_head_dim": 128, | |
| "index_n_heads": 64, | |
| "index_topk": 2048, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 18432, | |
| "kv_lora_rank": 512, | |
| "layer_types": [ | |
| "deepseek_sparse_attention", | |
| "deepseek_sparse_attention" | |
| ], | |
| "max_position_embeddings": 8192, | |
| "mlp_bias": false, | |
| "mlp_layer_types": [ | |
| "dense", | |
| "sparse" | |
| ], | |
| "model_type": "axk2", | |
| "moe_intermediate_size": 2048, | |
| "n_group": 1, | |
| "n_routed_experts": 2, | |
| "n_shared_experts": 1, | |
| "norm_topk_prob": true, | |
| "num_attention_heads": 64, | |
| "num_experts_per_tok": 1, | |
| "num_hidden_layers": 2, | |
| "num_key_value_heads": 64, | |
| "num_nextn_predict_layers": 0, | |
| "pad_token_id": 163692, | |
| "pretraining_tp": 1, | |
| "q_lora_rank": 1536, | |
| "qk_head_dim": 192, | |
| "qk_nope_head_dim": 128, | |
| "qk_rope_head_dim": 64, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "beta_fast": 32.0, | |
| "beta_slow": 1.0, | |
| "factor": 2.0, | |
| "mscale": 1.0, | |
| "mscale_all_dim": 1.0, | |
| "original_max_position_embeddings": 4096, | |
| "rope_theta": 1000000, | |
| "rope_type": "yarn" | |
| }, | |
| "routed_scaling_factor": 2.5, | |
| "scoring_func": "sigmoid", | |
| "seq_aux": true, | |
| "tie_word_embeddings": false, | |
| "topk_group": 1, | |
| "topk_method": "noaux_tc", | |
| "transformers_version": "5.15.0.dev0", | |
| "use_cache": true, | |
| "v_head_dim": 128, | |
| "vocab_size": 163840 | |
| } | |