Text Generation
Transformers
Safetensors
llama
conversational
text-generation-inference
8-bit precision
compressed-tensors
Instructions to use nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2") model = AutoModelForMultimodalLM.from_pretrained("nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2") 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-oneshot-w8a8-dynamic-token-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2" # 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-oneshot-w8a8-dynamic-token-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2
- SGLang
How to use nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2 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-oneshot-w8a8-dynamic-token-v2" \ --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-oneshot-w8a8-dynamic-token-v2", "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-oneshot-w8a8-dynamic-token-v2" \ --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-oneshot-w8a8-dynamic-token-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2 with Docker Model Runner:
docker model run hf.co/nm-testing/tinyllama-oneshot-w8a8-dynamic-token-v2
Upload folder using huggingface_hub
Browse files- config.json +37 -39
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -7,48 +7,46 @@
|
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 1,
|
| 9 |
"compression_config": {
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
"
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
"
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
"type": "int"
|
| 38 |
-
}
|
| 39 |
}
|
| 40 |
-
}
|
| 41 |
-
"format": "int-quantized",
|
| 42 |
-
"global_compression_ratio": 1.2391304140415598,
|
| 43 |
-
"ignore": [
|
| 44 |
-
"lm_head"
|
| 45 |
-
],
|
| 46 |
-
"quant_method": "sparseml",
|
| 47 |
-
"quantization_status": "frozen"
|
| 48 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
"sparsity_config": {
|
| 50 |
"format": "dense",
|
| 51 |
-
"global_sparsity": 7.
|
| 52 |
"registry_requires_subclass": false,
|
| 53 |
"sparsity_structure": "unstructured"
|
| 54 |
}
|
|
@@ -68,7 +66,7 @@
|
|
| 68 |
"rope_scaling": null,
|
| 69 |
"rope_theta": 10000.0,
|
| 70 |
"tie_word_embeddings": false,
|
| 71 |
-
"torch_dtype": "
|
| 72 |
"transformers_version": "4.40.0",
|
| 73 |
"use_cache": true,
|
| 74 |
"vocab_size": 32000
|
|
|
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 1,
|
| 9 |
"compression_config": {
|
| 10 |
+
"config_groups": {
|
| 11 |
+
"group_0": {
|
| 12 |
+
"input_activations": {
|
| 13 |
+
"block_structure": null,
|
| 14 |
+
"dynamic": true,
|
| 15 |
+
"group_size": null,
|
| 16 |
+
"num_bits": 8,
|
| 17 |
+
"observer": "memoryless",
|
| 18 |
+
"observer_kwargs": {},
|
| 19 |
+
"strategy": "token",
|
| 20 |
+
"symmetric": true,
|
| 21 |
+
"type": "int"
|
| 22 |
+
},
|
| 23 |
+
"output_activations": null,
|
| 24 |
+
"targets": [
|
| 25 |
+
"Linear"
|
| 26 |
+
],
|
| 27 |
+
"weights": {
|
| 28 |
+
"block_structure": null,
|
| 29 |
+
"dynamic": false,
|
| 30 |
+
"group_size": null,
|
| 31 |
+
"num_bits": 8,
|
| 32 |
+
"observer": "minmax",
|
| 33 |
+
"observer_kwargs": {},
|
| 34 |
+
"strategy": "tensor",
|
| 35 |
+
"symmetric": true,
|
| 36 |
+
"type": "int"
|
|
|
|
|
|
|
| 37 |
}
|
| 38 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
},
|
| 40 |
+
"format": "int-quantized",
|
| 41 |
+
"global_compression_ratio": 1.2391304140415598,
|
| 42 |
+
"ignore": [
|
| 43 |
+
"lm_head"
|
| 44 |
+
],
|
| 45 |
+
"quant_method": "compressed-tensors",
|
| 46 |
+
"quantization_status": "frozen",
|
| 47 |
"sparsity_config": {
|
| 48 |
"format": "dense",
|
| 49 |
+
"global_sparsity": 7.826375935115232,
|
| 50 |
"registry_requires_subclass": false,
|
| 51 |
"sparsity_structure": "unstructured"
|
| 52 |
}
|
|
|
|
| 66 |
"rope_scaling": null,
|
| 67 |
"rope_theta": 10000.0,
|
| 68 |
"tie_word_embeddings": false,
|
| 69 |
+
"torch_dtype": "float16",
|
| 70 |
"transformers_version": "4.40.0",
|
| 71 |
"use_cache": true,
|
| 72 |
"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:6b77c5cda8b7af33e238158ceadff4e01d904b0ef3e66c19cb04fa6f628b35a1
|
| 3 |
+
size 1231252356
|