Text Generation
Transformers
Safetensors
English
Chinese
k2_horizon
k2-horizon
0.9b
dense
reasoning
knowledge-distillation
ifm
conversational
custom_code
Instructions to use IFM/K2-Horizon-0.9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IFM/K2-Horizon-0.9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IFM/K2-Horizon-0.9B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IFM/K2-Horizon-0.9B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IFM/K2-Horizon-0.9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IFM/K2-Horizon-0.9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/K2-Horizon-0.9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/IFM/K2-Horizon-0.9B
- SGLang
How to use IFM/K2-Horizon-0.9B 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 "IFM/K2-Horizon-0.9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/K2-Horizon-0.9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "IFM/K2-Horizon-0.9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/K2-Horizon-0.9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use IFM/K2-Horizon-0.9B with Docker Model Runner:
docker model run hf.co/IFM/K2-Horizon-0.9B
Upload ifm_tokenizer_manifest.json to rl-mopd
Browse files- ifm_tokenizer_manifest.json +89 -0
ifm_tokenizer_manifest.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"source_tokenizer": "/lustrefs/users/junlin.chen/data/tokenizers/jais64k_bbq_chat_nonspecial_toolthink",
|
| 3 |
+
"source_template": "/lustrefs/users/bbqbyte/workspace/code/bbq-chat-template/bbq-0610",
|
| 4 |
+
"token_id_replacements": {
|
| 5 |
+
"64018": {
|
| 6 |
+
"content": "<|ifm|im_start|>",
|
| 7 |
+
"special": true
|
| 8 |
+
},
|
| 9 |
+
"64019": {
|
| 10 |
+
"content": "<|ifm|im_end|>",
|
| 11 |
+
"special": true
|
| 12 |
+
},
|
| 13 |
+
"64029": {
|
| 14 |
+
"content": "<ifm|think>",
|
| 15 |
+
"special": false
|
| 16 |
+
},
|
| 17 |
+
"64030": {
|
| 18 |
+
"content": "</ifm|think>",
|
| 19 |
+
"special": false
|
| 20 |
+
},
|
| 21 |
+
"64041": {
|
| 22 |
+
"content": "<ifm|tools>",
|
| 23 |
+
"special": false
|
| 24 |
+
},
|
| 25 |
+
"64042": {
|
| 26 |
+
"content": "</ifm|tools>",
|
| 27 |
+
"special": false
|
| 28 |
+
},
|
| 29 |
+
"64043": {
|
| 30 |
+
"content": "<ifm|tool_call>",
|
| 31 |
+
"special": false
|
| 32 |
+
},
|
| 33 |
+
"64044": {
|
| 34 |
+
"content": "</ifm|tool_call>",
|
| 35 |
+
"special": false
|
| 36 |
+
},
|
| 37 |
+
"64050": {
|
| 38 |
+
"content": "<ifm|think_fast>",
|
| 39 |
+
"special": false
|
| 40 |
+
},
|
| 41 |
+
"64051": {
|
| 42 |
+
"content": "</ifm|think_fast>",
|
| 43 |
+
"special": false
|
| 44 |
+
},
|
| 45 |
+
"64052": {
|
| 46 |
+
"content": "<ifm|think_faster>",
|
| 47 |
+
"special": false
|
| 48 |
+
},
|
| 49 |
+
"64053": {
|
| 50 |
+
"content": "</ifm|think_faster>",
|
| 51 |
+
"special": false
|
| 52 |
+
},
|
| 53 |
+
"64054": {
|
| 54 |
+
"content": "<ifm|tool_calls>",
|
| 55 |
+
"special": false
|
| 56 |
+
},
|
| 57 |
+
"64055": {
|
| 58 |
+
"content": "</ifm|tool_calls>",
|
| 59 |
+
"special": false
|
| 60 |
+
},
|
| 61 |
+
"64056": {
|
| 62 |
+
"content": "<ifm|arg_key>",
|
| 63 |
+
"special": false
|
| 64 |
+
},
|
| 65 |
+
"64057": {
|
| 66 |
+
"content": "</ifm|arg_key>",
|
| 67 |
+
"special": false
|
| 68 |
+
},
|
| 69 |
+
"64058": {
|
| 70 |
+
"content": "<ifm|arg_type>",
|
| 71 |
+
"special": false
|
| 72 |
+
},
|
| 73 |
+
"64059": {
|
| 74 |
+
"content": "</ifm|arg_type>",
|
| 75 |
+
"special": false
|
| 76 |
+
},
|
| 77 |
+
"64060": {
|
| 78 |
+
"content": "<ifm|arg_value>",
|
| 79 |
+
"special": false
|
| 80 |
+
},
|
| 81 |
+
"64061": {
|
| 82 |
+
"content": "</ifm|arg_value>",
|
| 83 |
+
"special": false
|
| 84 |
+
}
|
| 85 |
+
},
|
| 86 |
+
"tool_presentation_format": "markdown",
|
| 87 |
+
"tool_call_format": "xml",
|
| 88 |
+
"vocab_size_unchanged": true
|
| 89 |
+
}
|