Text Generation
Transformers
Safetensors
English
lfm
prism
gspo
hybrid-architecture
tool-use
Thinking
Instructions to use Ex0bit/lfm-Nanotron with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ex0bit/lfm-Nanotron with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ex0bit/lfm-Nanotron")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Ex0bit/lfm-Nanotron", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Ex0bit/lfm-Nanotron with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ex0bit/lfm-Nanotron" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ex0bit/lfm-Nanotron", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Ex0bit/lfm-Nanotron
- SGLang
How to use Ex0bit/lfm-Nanotron 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 "Ex0bit/lfm-Nanotron" \ --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": "Ex0bit/lfm-Nanotron", "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 "Ex0bit/lfm-Nanotron" \ --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": "Ex0bit/lfm-Nanotron", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Ex0bit/lfm-Nanotron with Docker Model Runner:
docker model run hf.co/Ex0bit/lfm-Nanotron
Add W4A16 AutoRound: config.json
Browse files- W4A16-AutoRound/config.json +85 -0
W4A16-AutoRound/config.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Lfm2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"block_auto_adjust_ff_dim": false,
|
| 6 |
+
"block_dim": 2048,
|
| 7 |
+
"block_ff_dim": 10752,
|
| 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_dim_out": 2048,
|
| 20 |
+
"conv_use_xavier_init": true,
|
| 21 |
+
"dtype": "bfloat16",
|
| 22 |
+
"eos_token_id": 7,
|
| 23 |
+
"hidden_size": 2048,
|
| 24 |
+
"initializer_range": 0.02,
|
| 25 |
+
"intermediate_size": 10752,
|
| 26 |
+
"layer_types": [
|
| 27 |
+
"conv",
|
| 28 |
+
"conv",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"conv",
|
| 31 |
+
"conv",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"conv",
|
| 34 |
+
"conv",
|
| 35 |
+
"conv",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"conv",
|
| 38 |
+
"conv",
|
| 39 |
+
"conv",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"conv",
|
| 42 |
+
"conv",
|
| 43 |
+
"conv",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"conv",
|
| 46 |
+
"conv",
|
| 47 |
+
"conv",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"conv",
|
| 50 |
+
"conv",
|
| 51 |
+
"full_attention",
|
| 52 |
+
"conv",
|
| 53 |
+
"conv",
|
| 54 |
+
"full_attention",
|
| 55 |
+
"conv",
|
| 56 |
+
"conv"
|
| 57 |
+
],
|
| 58 |
+
"max_position_embeddings": 128000,
|
| 59 |
+
"model_type": "lfm2",
|
| 60 |
+
"norm_eps": 1e-05,
|
| 61 |
+
"num_attention_heads": 32,
|
| 62 |
+
"num_heads": 32,
|
| 63 |
+
"num_hidden_layers": 30,
|
| 64 |
+
"num_key_value_heads": 8,
|
| 65 |
+
"pad_token_id": 0,
|
| 66 |
+
"quantization_config": {
|
| 67 |
+
"autoround_version": "0.9.5",
|
| 68 |
+
"bits": 4,
|
| 69 |
+
"data_type": "int",
|
| 70 |
+
"group_size": 128,
|
| 71 |
+
"iters": 500,
|
| 72 |
+
"nsamples": 512,
|
| 73 |
+
"packing_format": "auto_round:auto_gptq",
|
| 74 |
+
"quant_method": "auto-round",
|
| 75 |
+
"sym": true
|
| 76 |
+
},
|
| 77 |
+
"rope_theta": 1000000.0,
|
| 78 |
+
"theta": 1000000.0,
|
| 79 |
+
"tie_embedding": true,
|
| 80 |
+
"transformers_version": "4.57.6",
|
| 81 |
+
"use_cache": false,
|
| 82 |
+
"use_grouped_mm": true,
|
| 83 |
+
"use_pos_enc": true,
|
| 84 |
+
"vocab_size": 65536
|
| 85 |
+
}
|