Instructions to use WokeAI/Tankie-LFM2.5-1.2B-SFT-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WokeAI/Tankie-LFM2.5-1.2B-SFT-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="WokeAI/Tankie-LFM2.5-1.2B-SFT-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("WokeAI/Tankie-LFM2.5-1.2B-SFT-v1") model = AutoModelForCausalLM.from_pretrained("WokeAI/Tankie-LFM2.5-1.2B-SFT-v1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use WokeAI/Tankie-LFM2.5-1.2B-SFT-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WokeAI/Tankie-LFM2.5-1.2B-SFT-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WokeAI/Tankie-LFM2.5-1.2B-SFT-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/WokeAI/Tankie-LFM2.5-1.2B-SFT-v1
- SGLang
How to use WokeAI/Tankie-LFM2.5-1.2B-SFT-v1 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 "WokeAI/Tankie-LFM2.5-1.2B-SFT-v1" \ --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": "WokeAI/Tankie-LFM2.5-1.2B-SFT-v1", "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 "WokeAI/Tankie-LFM2.5-1.2B-SFT-v1" \ --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": "WokeAI/Tankie-LFM2.5-1.2B-SFT-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use WokeAI/Tankie-LFM2.5-1.2B-SFT-v1 with Docker Model Runner:
docker model run hf.co/WokeAI/Tankie-LFM2.5-1.2B-SFT-v1
Upload folder using huggingface_hub
Browse files- README.md +137 -0
- chat_template.jinja +45 -0
- config.json +61 -0
- debug.log +11 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +20 -0
README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: other
|
| 4 |
+
base_model: LiquidAI/LFM2.5-1.2B-Instruct
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
datasets:
|
| 8 |
+
- WokeAI/polititune-tankie-warmup-3
|
| 9 |
+
model-index:
|
| 10 |
+
- name: model-output
|
| 11 |
+
results: []
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 15 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 16 |
+
|
| 17 |
+
[<img src="https://raw.githubusercontent.com/axolotl-ai-cloud/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/axolotl-ai-cloud/axolotl)
|
| 18 |
+
<details><summary>See axolotl config</summary>
|
| 19 |
+
|
| 20 |
+
axolotl version: `0.15.0.dev0`
|
| 21 |
+
```yaml
|
| 22 |
+
# === Model Configuration ===
|
| 23 |
+
base_model: LiquidAI/LFM2.5-1.2B-Instruct
|
| 24 |
+
load_in_8bit: false
|
| 25 |
+
load_in_4bit: false
|
| 26 |
+
|
| 27 |
+
# === Training Setup ===
|
| 28 |
+
num_epochs: 4
|
| 29 |
+
micro_batch_size: 2
|
| 30 |
+
gradient_accumulation_steps: 2
|
| 31 |
+
sequence_len: 2048
|
| 32 |
+
sample_packing: true
|
| 33 |
+
pad_to_sequence_len: true
|
| 34 |
+
|
| 35 |
+
# === Hyperparameter Configuration ===
|
| 36 |
+
optimizer: adamw_torch_8bit
|
| 37 |
+
learning_rate: 5e-5
|
| 38 |
+
lr_scheduler: constant
|
| 39 |
+
weight_decay: 0.001
|
| 40 |
+
max_grad_norm: 0.1
|
| 41 |
+
warmup_ratio: 0.2
|
| 42 |
+
cosine_min_lr_ratio: 0.1
|
| 43 |
+
|
| 44 |
+
# === Data Configuration ===
|
| 45 |
+
datasets:
|
| 46 |
+
- path: WokeAI/polititune-tankie-warmup-3
|
| 47 |
+
type: chat_template
|
| 48 |
+
split: train
|
| 49 |
+
chat_template: tokenizer_default
|
| 50 |
+
|
| 51 |
+
dataset_prepared_path: last_run_prepared
|
| 52 |
+
|
| 53 |
+
# === Hardware Optimization ===
|
| 54 |
+
gradient_checkpointing: offload
|
| 55 |
+
|
| 56 |
+
# === Wandb Tracking ===
|
| 57 |
+
wandb_project: polititune-3-lfm2.5_1.2b-warmup
|
| 58 |
+
|
| 59 |
+
# === Checkpointing ===
|
| 60 |
+
saves_per_epoch: 1
|
| 61 |
+
|
| 62 |
+
# === Advanced Settings ===
|
| 63 |
+
output_dir: ./model-output
|
| 64 |
+
bf16: auto
|
| 65 |
+
flash_attention: true
|
| 66 |
+
train_on_inputs: false
|
| 67 |
+
group_by_length: false
|
| 68 |
+
logging_steps: 1
|
| 69 |
+
trust_remote_code: false
|
| 70 |
+
|
| 71 |
+
plugins:
|
| 72 |
+
- axolotl.integrations.liger.LigerPlugin
|
| 73 |
+
# - axolotl.integrations.cut_cross_entropy.CutCrossEntropyPlugin
|
| 74 |
+
|
| 75 |
+
fsdp:
|
| 76 |
+
- auto_wrap
|
| 77 |
+
- full_shard
|
| 78 |
+
fsdp_config:
|
| 79 |
+
fsdp_version: 2
|
| 80 |
+
fsdp_offload_params: false
|
| 81 |
+
fsdp_cpu_ram_efficient_loading: true
|
| 82 |
+
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
|
| 83 |
+
fsdp_transformer_layer_cls_to_wrap: Lfm2DecoderLayer
|
| 84 |
+
fsdp_state_dict_type: SHARDED_STATE_DICT
|
| 85 |
+
fsdp_sharding_strategy: FULL_SHARD
|
| 86 |
+
fsdp_reshard_after_forward: true
|
| 87 |
+
fsdp_activation_checkpointing: true # will disable if doesnt work
|
| 88 |
+
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
</details><br>
|
| 92 |
+
|
| 93 |
+
# model-output
|
| 94 |
+
|
| 95 |
+
This model is a fine-tuned version of [LiquidAI/LFM2.5-1.2B-Instruct](https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct) on the WokeAI/polititune-tankie-warmup-3 dataset.
|
| 96 |
+
|
| 97 |
+
## Model description
|
| 98 |
+
|
| 99 |
+
More information needed
|
| 100 |
+
|
| 101 |
+
## Intended uses & limitations
|
| 102 |
+
|
| 103 |
+
More information needed
|
| 104 |
+
|
| 105 |
+
## Training and evaluation data
|
| 106 |
+
|
| 107 |
+
More information needed
|
| 108 |
+
|
| 109 |
+
## Training procedure
|
| 110 |
+
|
| 111 |
+
### Training hyperparameters
|
| 112 |
+
|
| 113 |
+
The following hyperparameters were used during training:
|
| 114 |
+
- learning_rate: 5e-05
|
| 115 |
+
- train_batch_size: 2
|
| 116 |
+
- eval_batch_size: 2
|
| 117 |
+
- seed: 42
|
| 118 |
+
- distributed_type: multi-GPU
|
| 119 |
+
- num_devices: 4
|
| 120 |
+
- gradient_accumulation_steps: 2
|
| 121 |
+
- total_train_batch_size: 16
|
| 122 |
+
- total_eval_batch_size: 8
|
| 123 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_8BIT with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 124 |
+
- lr_scheduler_type: constant
|
| 125 |
+
- lr_scheduler_warmup_steps: 24
|
| 126 |
+
- training_steps: 120
|
| 127 |
+
|
| 128 |
+
### Training results
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
### Framework versions
|
| 133 |
+
|
| 134 |
+
- Transformers 5.0.0
|
| 135 |
+
- Pytorch 2.8.0+cu128
|
| 136 |
+
- Datasets 4.5.0
|
| 137 |
+
- Tokenizers 0.22.2
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token -}}
|
| 2 |
+
{%- set keep_past_thinking = keep_past_thinking | default(false) -%}
|
| 3 |
+
{%- set ns = namespace(system_prompt="") -%}
|
| 4 |
+
{%- if messages[0]["role"] == "system" -%}
|
| 5 |
+
{%- set ns.system_prompt = messages[0]["content"] -%}
|
| 6 |
+
{%- set messages = messages[1:] -%}
|
| 7 |
+
{%- endif -%}
|
| 8 |
+
{%- if tools -%}
|
| 9 |
+
{%- set ns.system_prompt = ns.system_prompt + ("\n" if ns.system_prompt else "") + "List of tools: [" -%}
|
| 10 |
+
{%- for tool in tools -%}
|
| 11 |
+
{%- if tool is not string -%}
|
| 12 |
+
{%- set tool = tool | tojson -%}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- set ns.system_prompt = ns.system_prompt + tool -%}
|
| 15 |
+
{%- if not loop.last -%}
|
| 16 |
+
{%- set ns.system_prompt = ns.system_prompt + ", " -%}
|
| 17 |
+
{%- endif -%}
|
| 18 |
+
{%- endfor -%}
|
| 19 |
+
{%- set ns.system_prompt = ns.system_prompt + "]" -%}
|
| 20 |
+
{%- endif -%}
|
| 21 |
+
{%- if ns.system_prompt -%}
|
| 22 |
+
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
| 23 |
+
{%- endif -%}
|
| 24 |
+
{%- set ns.last_assistant_index = -1 -%}
|
| 25 |
+
{%- for message in messages -%}
|
| 26 |
+
{%- if message["role"] == "assistant" -%}
|
| 27 |
+
{%- set ns.last_assistant_index = loop.index0 -%}
|
| 28 |
+
{%- endif -%}
|
| 29 |
+
{%- endfor -%}
|
| 30 |
+
{%- for message in messages -%}
|
| 31 |
+
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
| 32 |
+
{%- set content = message["content"] -%}
|
| 33 |
+
{%- if content is not string -%}
|
| 34 |
+
{%- set content = content | tojson -%}
|
| 35 |
+
{%- endif -%}
|
| 36 |
+
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
| 37 |
+
{%- if "</think>" in content -%}
|
| 38 |
+
{%- set content = content.split("</think>")[-1] | trim -%}
|
| 39 |
+
{%- endif -%}
|
| 40 |
+
{%- endif -%}
|
| 41 |
+
{{- content + "<|im_end|>\n" -}}
|
| 42 |
+
{%- endfor -%}
|
| 43 |
+
{%- if add_generation_prompt -%}
|
| 44 |
+
{{- "<|im_start|>assistant\n" -}}
|
| 45 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Lfm2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"block_auto_adjust_ff_dim": true,
|
| 6 |
+
"block_dim": 2048,
|
| 7 |
+
"block_ff_dim": 12288,
|
| 8 |
+
"block_ffn_dim_multiplier": 1.0,
|
| 9 |
+
"block_mlp_init_scale": 1.0,
|
| 10 |
+
"block_multiple_of": 256,
|
| 11 |
+
"block_norm_eps": 1e-05,
|
| 12 |
+
"block_out_init_scale": 1.0,
|
| 13 |
+
"block_use_swiglu": true,
|
| 14 |
+
"block_use_xavier_init": true,
|
| 15 |
+
"bos_token_id": 1,
|
| 16 |
+
"conv_L_cache": 3,
|
| 17 |
+
"conv_bias": false,
|
| 18 |
+
"conv_dim": 2048,
|
| 19 |
+
"conv_use_xavier_init": true,
|
| 20 |
+
"dtype": "bfloat16",
|
| 21 |
+
"eos_token_id": 7,
|
| 22 |
+
"hidden_size": 2048,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 12288,
|
| 25 |
+
"layer_types": [
|
| 26 |
+
"conv",
|
| 27 |
+
"conv",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"conv",
|
| 30 |
+
"conv",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"conv",
|
| 33 |
+
"conv",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"conv",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"conv",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"conv",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"conv"
|
| 42 |
+
],
|
| 43 |
+
"max_position_embeddings": 128000,
|
| 44 |
+
"model_type": "lfm2",
|
| 45 |
+
"norm_eps": 1e-05,
|
| 46 |
+
"num_attention_heads": 32,
|
| 47 |
+
"num_heads": 32,
|
| 48 |
+
"num_hidden_layers": 16,
|
| 49 |
+
"num_key_value_heads": 8,
|
| 50 |
+
"pad_token_id": 0,
|
| 51 |
+
"rope_parameters": {
|
| 52 |
+
"rope_theta": 1000000.0,
|
| 53 |
+
"rope_type": "default"
|
| 54 |
+
},
|
| 55 |
+
"tie_embedding": true,
|
| 56 |
+
"tie_word_embeddings": true,
|
| 57 |
+
"transformers_version": "5.0.0",
|
| 58 |
+
"use_cache": false,
|
| 59 |
+
"use_pos_enc": true,
|
| 60 |
+
"vocab_size": 65536
|
| 61 |
+
}
|
debug.log
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[2026-02-08 20:44:08,881] [WARNING] [huggingface_hub.utils._http._warn_on_warning_headers:779] [PID:10500] Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
|
| 2 |
+
[2026-02-08 20:44:11,018] [WARNING] [py.warnings._showwarnmsg:110] [PID:10500] /root/axolotl/.venv/lib/python3.12/site-packages/torch/distributed/distributed_c10d.py:4807: UserWarning: No device id is provided via `init_process_group` or `barrier `. Using the current device set by the user.
|
| 3 |
+
warnings.warn( # warn only once
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
[2026-02-08 20:44:36,298] [WARNING] [accelerate.utils.dataclasses.__post_init__:1962] [PID:10500] sync_module_states is obsolete in FSDP2, as it is not needed anymore.Setting sync_module_states to None.Multiple deprecation warnings due to FSDP2 conversion:
|
| 7 |
+
sharding_strategy is deprecated in favor of reshard_after_forward. This will be removed in a future version of Accelerate.
|
| 8 |
+
[2026-02-08 20:44:37,935] [WARNING] [py.warnings._showwarnmsg:110] [PID:10500] /root/axolotl/.venv/lib/python3.12/site-packages/torch/distributed/distributed_c10d.py:4807: UserWarning: No device id is provided via `init_process_group` or `barrier `. Using the current device set by the user.
|
| 9 |
+
warnings.warn( # warn only once
|
| 10 |
+
|
| 11 |
+
[0m
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81efae66588f15d91bd9f9fe617dd5fc607b6821d9ae6f41c012baefdb67bab8
|
| 3 |
+
size 2609133520
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|startoftext|>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|im_end|>",
|
| 6 |
+
"is_local": false,
|
| 7 |
+
"legacy": false,
|
| 8 |
+
"model_input_names": [
|
| 9 |
+
"input_ids",
|
| 10 |
+
"attention_mask"
|
| 11 |
+
],
|
| 12 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 13 |
+
"model_specific_special_tokens": {},
|
| 14 |
+
"pad_token": "<|pad|>",
|
| 15 |
+
"sp_model_kwargs": {},
|
| 16 |
+
"spaces_between_special_tokens": false,
|
| 17 |
+
"tokenizer_class": "TokenizersBackend",
|
| 18 |
+
"use_default_system_prompt": false,
|
| 19 |
+
"use_fast": true
|
| 20 |
+
}
|