Text Generation
Transformers
Safetensors
llama
conversational
text-generation-inference
8-bit precision
compressed-tensors
Instructions to use nm-testing/tinyllama-oneshot-w8a8-static-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-static-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-static-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nm-testing/tinyllama-oneshot-w8a8-static-v2") model = AutoModelForCausalLM.from_pretrained("nm-testing/tinyllama-oneshot-w8a8-static-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
- vLLM
How to use nm-testing/tinyllama-oneshot-w8a8-static-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-static-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-static-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nm-testing/tinyllama-oneshot-w8a8-static-v2
- SGLang
How to use nm-testing/tinyllama-oneshot-w8a8-static-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-static-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-static-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-static-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-static-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nm-testing/tinyllama-oneshot-w8a8-static-v2 with Docker Model Runner:
docker model run hf.co/nm-testing/tinyllama-oneshot-w8a8-static-v2
Upload folder using huggingface_hub
Browse files- config.json +2 -2
- model.safetensors +2 -2
- recipe.yaml +2 -2
- special_tokens_map.json +1 -7
- tokenizer_config.json +1 -1
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "/root/.cache/huggingface/hub/models--TinyLlama--TinyLlama-1.1B-
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
@@ -46,7 +46,7 @@
|
|
| 46 |
"quantization_status": "frozen",
|
| 47 |
"sparsity_config": {
|
| 48 |
"format": "dense",
|
| 49 |
-
"global_sparsity": 7.
|
| 50 |
"registry_requires_subclass": false,
|
| 51 |
"sparsity_structure": "unstructured"
|
| 52 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "/root/.cache/huggingface/hub/models--TinyLlama--TinyLlama-1.1B-intermediate-step-1431k-3T/snapshots/036fa4651240b9a1487f709833b9e4b96b4c1574",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 46 |
"quantization_status": "frozen",
|
| 47 |
"sparsity_config": {
|
| 48 |
"format": "dense",
|
| 49 |
+
"global_sparsity": 7.819616777874382,
|
| 50 |
"registry_requires_subclass": false,
|
| 51 |
"sparsity_structure": "unstructured"
|
| 52 |
}
|
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:e0b88c21c6ee2080c22ed7ee689c5f0f4dfa89b598ec702953d950c0638512c6
|
| 3 |
+
size 1231270112
|
recipe.yaml
CHANGED
|
@@ -5,6 +5,6 @@ quant_stage:
|
|
| 5 |
ignore: [lm_head]
|
| 6 |
config_groups:
|
| 7 |
group_0:
|
| 8 |
-
weights: {num_bits: 8, type: int, symmetric: true
|
| 9 |
-
input_activations: {num_bits: 8, type: int, symmetric: true
|
| 10 |
targets: [Linear]
|
|
|
|
| 5 |
ignore: [lm_head]
|
| 6 |
config_groups:
|
| 7 |
group_0:
|
| 8 |
+
weights: {num_bits: 8, type: int, symmetric: true}
|
| 9 |
+
input_activations: {num_bits: 8, type: int, symmetric: true}
|
| 10 |
targets: [Linear]
|
special_tokens_map.json
CHANGED
|
@@ -13,13 +13,7 @@
|
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
-
"pad_token":
|
| 17 |
-
"content": "</s>",
|
| 18 |
-
"lstrip": false,
|
| 19 |
-
"normalized": false,
|
| 20 |
-
"rstrip": false,
|
| 21 |
-
"single_word": false
|
| 22 |
-
},
|
| 23 |
"unk_token": {
|
| 24 |
"content": "<unk>",
|
| 25 |
"lstrip": false,
|
|
|
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
+
"pad_token": "</s>",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"unk_token": {
|
| 18 |
"content": "<unk>",
|
| 19 |
"lstrip": false,
|
tokenizer_config.json
CHANGED
|
@@ -32,7 +32,7 @@
|
|
| 32 |
"clean_up_tokenization_spaces": false,
|
| 33 |
"eos_token": "</s>",
|
| 34 |
"legacy": false,
|
| 35 |
-
"model_max_length":
|
| 36 |
"pad_token": "</s>",
|
| 37 |
"padding_side": "right",
|
| 38 |
"sp_model_kwargs": {},
|
|
|
|
| 32 |
"clean_up_tokenization_spaces": false,
|
| 33 |
"eos_token": "</s>",
|
| 34 |
"legacy": false,
|
| 35 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 36 |
"pad_token": "</s>",
|
| 37 |
"padding_side": "right",
|
| 38 |
"sp_model_kwargs": {},
|