Text Generation
Transformers
Safetensors
llama
conversational
text-generation-inference
8-bit precision
compressed-tensors
Instructions to use nm-testing/tinyllama-one-shot-static-quant-test-compressed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nm-testing/tinyllama-one-shot-static-quant-test-compressed with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nm-testing/tinyllama-one-shot-static-quant-test-compressed") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nm-testing/tinyllama-one-shot-static-quant-test-compressed") model = AutoModelForCausalLM.from_pretrained("nm-testing/tinyllama-one-shot-static-quant-test-compressed") 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 nm-testing/tinyllama-one-shot-static-quant-test-compressed with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nm-testing/tinyllama-one-shot-static-quant-test-compressed" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nm-testing/tinyllama-one-shot-static-quant-test-compressed", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nm-testing/tinyllama-one-shot-static-quant-test-compressed
- SGLang
How to use nm-testing/tinyllama-one-shot-static-quant-test-compressed 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 "nm-testing/tinyllama-one-shot-static-quant-test-compressed" \ --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": "nm-testing/tinyllama-one-shot-static-quant-test-compressed", "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 "nm-testing/tinyllama-one-shot-static-quant-test-compressed" \ --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": "nm-testing/tinyllama-one-shot-static-quant-test-compressed", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nm-testing/tinyllama-one-shot-static-quant-test-compressed with Docker Model Runner:
docker model run hf.co/nm-testing/tinyllama-one-shot-static-quant-test-compressed
Upload folder using huggingface_hub
Browse files- config.json +3 -4
- model.safetensors +2 -2
- recipe.yaml +2 -2
config.json
CHANGED
|
@@ -39,9 +39,8 @@
|
|
| 39 |
}
|
| 40 |
},
|
| 41 |
"format": "int-quantized",
|
| 42 |
-
"global_compression_ratio": 1.
|
| 43 |
"ignore": [
|
| 44 |
-
"model.layers.0.mlp.down_proj",
|
| 45 |
"lm_head"
|
| 46 |
],
|
| 47 |
"quant_method": "sparseml",
|
|
@@ -49,7 +48,7 @@
|
|
| 49 |
},
|
| 50 |
"sparsity_config": {
|
| 51 |
"format": "dense",
|
| 52 |
-
"global_sparsity": 7.
|
| 53 |
"registry_requires_subclass": false,
|
| 54 |
"sparsity_structure": "0:0"
|
| 55 |
}
|
|
@@ -69,7 +68,7 @@
|
|
| 69 |
"rope_scaling": null,
|
| 70 |
"rope_theta": 10000.0,
|
| 71 |
"tie_word_embeddings": false,
|
| 72 |
-
"torch_dtype": "
|
| 73 |
"transformers_version": "4.39.0",
|
| 74 |
"use_cache": true,
|
| 75 |
"vocab_size": 32000
|
|
|
|
| 39 |
}
|
| 40 |
},
|
| 41 |
"format": "int-quantized",
|
| 42 |
+
"global_compression_ratio": 1.4583332397611055,
|
| 43 |
"ignore": [
|
|
|
|
| 44 |
"lm_head"
|
| 45 |
],
|
| 46 |
"quant_method": "sparseml",
|
|
|
|
| 48 |
},
|
| 49 |
"sparsity_config": {
|
| 50 |
"format": "dense",
|
| 51 |
+
"global_sparsity": 7.8259900429979625,
|
| 52 |
"registry_requires_subclass": false,
|
| 53 |
"sparsity_structure": "0:0"
|
| 54 |
}
|
|
|
|
| 68 |
"rope_scaling": null,
|
| 69 |
"rope_theta": 10000.0,
|
| 70 |
"tie_word_embeddings": false,
|
| 71 |
+
"torch_dtype": "float16",
|
| 72 |
"transformers_version": "4.39.0",
|
| 73 |
"use_cache": true,
|
| 74 |
"vocab_size": 32000
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e50b56978024a9aed7179f00aabd8689c07912534fa25058fd873c39f3e687bd
|
| 3 |
+
size 1231304860
|
recipe.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
|
| 2 |
quant_modifiers:
|
| 3 |
vLLMQuantizationModifier:
|
| 4 |
-
ignore: [lm_head
|
| 5 |
config_groups:
|
| 6 |
group_0:
|
| 7 |
weights: {num_bits: 8, type: int, symmetric: true, strategy: tensor}
|
|
|
|
| 1 |
+
test_stage:
|
| 2 |
quant_modifiers:
|
| 3 |
vLLMQuantizationModifier:
|
| 4 |
+
ignore: [lm_head]
|
| 5 |
config_groups:
|
| 6 |
group_0:
|
| 7 |
weights: {num_bits: 8, type: int, symmetric: true, strategy: tensor}
|