Text Generation
Transformers
Safetensors
llama
conversational
text-generation-inference
4-bit precision
gptq
Instructions to use PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0") model = AutoModelForCausalLM.from_pretrained("PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0
- SGLang
How to use PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0 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 "PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0" \ --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": "PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0", "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 "PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0" \ --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": "PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0 with Docker Model Runner:
docker model run hf.co/PruningVSQuantization/SmolLM2-1.7B-Instruct-gptq-bits4-seed0
Upload LlamaForCausalLM
Browse files- config.json +73 -0
- generation_config.json +7 -0
- model.safetensors +3 -0
config.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 2,
|
| 9 |
+
"head_dim": 64,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 2048,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 8192,
|
| 14 |
+
"max_position_embeddings": 8192,
|
| 15 |
+
"mlp_bias": false,
|
| 16 |
+
"model_type": "llama",
|
| 17 |
+
"num_attention_heads": 32,
|
| 18 |
+
"num_hidden_layers": 24,
|
| 19 |
+
"num_key_value_heads": 32,
|
| 20 |
+
"pad_token_id": 2,
|
| 21 |
+
"pretraining_tp": 1,
|
| 22 |
+
"quantization_config": {
|
| 23 |
+
"backend": "auto",
|
| 24 |
+
"batch_size": 1,
|
| 25 |
+
"bits": 4,
|
| 26 |
+
"block_name_to_quantize": null,
|
| 27 |
+
"cache_block_outputs": true,
|
| 28 |
+
"checkpoint_format": "gptq_v2",
|
| 29 |
+
"damp_percent": 0.1,
|
| 30 |
+
"dataset": "c4",
|
| 31 |
+
"desc_act": false,
|
| 32 |
+
"exllama_config": {
|
| 33 |
+
"version": 1
|
| 34 |
+
},
|
| 35 |
+
"group_size": 128,
|
| 36 |
+
"max_input_length": null,
|
| 37 |
+
"meta": {
|
| 38 |
+
"quantizer": [
|
| 39 |
+
"optimum:1.24.0",
|
| 40 |
+
"gptqmodel:2.2.0"
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
"model_seqlen": null,
|
| 44 |
+
"module_name_preceding_first_block": null,
|
| 45 |
+
"modules_in_block_to_quantize": null,
|
| 46 |
+
"pad_token_id": null,
|
| 47 |
+
"quant_method": "gptq",
|
| 48 |
+
"sym": true,
|
| 49 |
+
"tokenizer": null,
|
| 50 |
+
"true_sequential": true,
|
| 51 |
+
"use_cuda_fp16": false,
|
| 52 |
+
"use_exllama": true
|
| 53 |
+
},
|
| 54 |
+
"rms_norm_eps": 1e-05,
|
| 55 |
+
"rope_scaling": null,
|
| 56 |
+
"rope_theta": 130000,
|
| 57 |
+
"tie_word_embeddings": true,
|
| 58 |
+
"torch_dtype": "float16",
|
| 59 |
+
"transformers.js_config": {
|
| 60 |
+
"dtype": "q4",
|
| 61 |
+
"kv_cache_dtype": {
|
| 62 |
+
"fp16": "float16",
|
| 63 |
+
"q4f16": "float16"
|
| 64 |
+
},
|
| 65 |
+
"use_external_data_format": {
|
| 66 |
+
"model.onnx": true,
|
| 67 |
+
"model_fp16.onnx": true
|
| 68 |
+
}
|
| 69 |
+
},
|
| 70 |
+
"transformers_version": "4.51.3",
|
| 71 |
+
"use_cache": true,
|
| 72 |
+
"vocab_size": 49152
|
| 73 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"pad_token_id": 2,
|
| 6 |
+
"transformers_version": "4.51.3"
|
| 7 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b3ca398833ce0d2b0a5f8298117c385131a527374f8fd354c81ec786ac55e77a
|
| 3 |
+
size 1038407104
|