Text Generation
Transformers
Safetensors
llama
conversational
text-generation-inference
8-bit precision
compressed-tensors
Instructions to use nm-testing/tinyllama-one-shot-dynamic-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nm-testing/tinyllama-one-shot-dynamic-test with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nm-testing/tinyllama-one-shot-dynamic-test") 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-dynamic-test") model = AutoModelForCausalLM.from_pretrained("nm-testing/tinyllama-one-shot-dynamic-test") 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
- vLLM
How to use nm-testing/tinyllama-one-shot-dynamic-test 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-dynamic-test" # 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-dynamic-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nm-testing/tinyllama-one-shot-dynamic-test
- SGLang
How to use nm-testing/tinyllama-one-shot-dynamic-test 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-dynamic-test" \ --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-dynamic-test", "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-dynamic-test" \ --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-dynamic-test", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nm-testing/tinyllama-one-shot-dynamic-test with Docker Model Runner:
docker model run hf.co/nm-testing/tinyllama-one-shot-dynamic-test
Upload folder using huggingface_hub
Browse files- config.json +6 -7
- generation_config.json +1 -1
- model.safetensors +2 -2
- recipe.yaml +6 -12
- tokenizer.json +1 -0
- tokenizer_config.json +1 -0
config.json
CHANGED
|
@@ -32,16 +32,15 @@
|
|
| 32 |
"num_bits": 8,
|
| 33 |
"observer": "minmax",
|
| 34 |
"observer_kwargs": {},
|
| 35 |
-
"strategy": "
|
| 36 |
"symmetric": true,
|
| 37 |
"type": "int"
|
| 38 |
}
|
| 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,9 +48,9 @@
|
|
| 49 |
},
|
| 50 |
"sparsity_config": {
|
| 51 |
"format": "dense",
|
| 52 |
-
"global_sparsity":
|
| 53 |
"registry_requires_subclass": false,
|
| 54 |
-
"sparsity_structure": "
|
| 55 |
}
|
| 56 |
},
|
| 57 |
"eos_token_id": 2,
|
|
@@ -69,8 +68,8 @@
|
|
| 69 |
"rope_scaling": null,
|
| 70 |
"rope_theta": 10000.0,
|
| 71 |
"tie_word_embeddings": false,
|
| 72 |
-
"torch_dtype": "
|
| 73 |
-
"transformers_version": "4.
|
| 74 |
"use_cache": true,
|
| 75 |
"vocab_size": 32000
|
| 76 |
}
|
|
|
|
| 32 |
"num_bits": 8,
|
| 33 |
"observer": "minmax",
|
| 34 |
"observer_kwargs": {},
|
| 35 |
+
"strategy": "channel",
|
| 36 |
"symmetric": true,
|
| 37 |
"type": "int"
|
| 38 |
}
|
| 39 |
}
|
| 40 |
},
|
| 41 |
"format": "int-quantized",
|
| 42 |
+
"global_compression_ratio": 1.2390773684863086,
|
| 43 |
"ignore": [
|
|
|
|
| 44 |
"lm_head"
|
| 45 |
],
|
| 46 |
"quant_method": "sparseml",
|
|
|
|
| 48 |
},
|
| 49 |
"sparsity_config": {
|
| 50 |
"format": "dense",
|
| 51 |
+
"global_sparsity": 1.188444907528722,
|
| 52 |
"registry_requires_subclass": false,
|
| 53 |
+
"sparsity_structure": "unstructured"
|
| 54 |
}
|
| 55 |
},
|
| 56 |
"eos_token_id": 2,
|
|
|
|
| 68 |
"rope_scaling": null,
|
| 69 |
"rope_theta": 10000.0,
|
| 70 |
"tie_word_embeddings": false,
|
| 71 |
+
"torch_dtype": "bfloat16",
|
| 72 |
+
"transformers_version": "4.40.0",
|
| 73 |
"use_cache": true,
|
| 74 |
"vocab_size": 32000
|
| 75 |
}
|
generation_config.json
CHANGED
|
@@ -3,5 +3,5 @@
|
|
| 3 |
"eos_token_id": 2,
|
| 4 |
"max_length": 2048,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
-
"transformers_version": "4.
|
| 7 |
}
|
|
|
|
| 3 |
"eos_token_id": 2,
|
| 4 |
"max_length": 2048,
|
| 5 |
"pad_token_id": 0,
|
| 6 |
+
"transformers_version": "4.40.0"
|
| 7 |
}
|
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:ed7796316a087eaf71963e35ff79ae097d02000411fc834b315d0bf399ad870c
|
| 3 |
+
size 1232041608
|
recipe.yaml
CHANGED
|
@@ -1,16 +1,10 @@
|
|
| 1 |
-
|
| 2 |
quant_modifiers:
|
| 3 |
-
|
| 4 |
-
|
|
|
|
| 5 |
config_groups:
|
| 6 |
group_0:
|
| 7 |
-
weights: {num_bits: 8, type: int, symmetric: true, strategy:
|
| 8 |
-
input_activations: {num_bits: 8, type: int, symmetric: true,
|
| 9 |
-
output_activations: null
|
| 10 |
targets: [Linear]
|
| 11 |
-
SparseGPTModifier:
|
| 12 |
-
sparsity: 0.0
|
| 13 |
-
block_size: 128
|
| 14 |
-
sequential_update: false
|
| 15 |
-
quantize: true
|
| 16 |
-
targets: ['re:model.layers.\d+$']
|
|
|
|
| 1 |
+
quant_stage:
|
| 2 |
quant_modifiers:
|
| 3 |
+
GPTQModifier:
|
| 4 |
+
sequential_update: false
|
| 5 |
+
ignore: [lm_head]
|
| 6 |
config_groups:
|
| 7 |
group_0:
|
| 8 |
+
weights: {num_bits: 8, type: int, symmetric: true, strategy: channel}
|
| 9 |
+
input_activations: {num_bits: 8, type: int, symmetric: true, dynamic: true, strategy: token}
|
|
|
|
| 10 |
targets: [Linear]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tokenizer.json
CHANGED
|
@@ -134,6 +134,7 @@
|
|
| 134 |
"end_of_word_suffix": null,
|
| 135 |
"fuse_unk": true,
|
| 136 |
"byte_fallback": true,
|
|
|
|
| 137 |
"vocab": {
|
| 138 |
"<unk>": 0,
|
| 139 |
"<s>": 1,
|
|
|
|
| 134 |
"end_of_word_suffix": null,
|
| 135 |
"fuse_unk": true,
|
| 136 |
"byte_fallback": true,
|
| 137 |
+
"ignore_merges": false,
|
| 138 |
"vocab": {
|
| 139 |
"<unk>": 0,
|
| 140 |
"<s>": 1,
|
tokenizer_config.json
CHANGED
|
@@ -28,6 +28,7 @@
|
|
| 28 |
}
|
| 29 |
},
|
| 30 |
"bos_token": "<s>",
|
|
|
|
| 31 |
"clean_up_tokenization_spaces": false,
|
| 32 |
"eos_token": "</s>",
|
| 33 |
"legacy": false,
|
|
|
|
| 28 |
}
|
| 29 |
},
|
| 30 |
"bos_token": "<s>",
|
| 31 |
+
"chat_template": "{% for message in messages %}\n{% if message['role'] == 'user' %}\n{{ '<|user|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'system' %}\n{{ '<|system|>\n' + message['content'] + eos_token }}\n{% elif message['role'] == 'assistant' %}\n{{ '<|assistant|>\n' + message['content'] + eos_token }}\n{% endif %}\n{% if loop.last and add_generation_prompt %}\n{{ '<|assistant|>' }}\n{% endif %}\n{% endfor %}",
|
| 32 |
"clean_up_tokenization_spaces": false,
|
| 33 |
"eos_token": "</s>",
|
| 34 |
"legacy": false,
|