Text Generation
Transformers
Safetensors
llama
conversational
text-generation-inference
compressed-tensors
Instructions to use nm-testing/nonuniform with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nm-testing/nonuniform with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nm-testing/nonuniform") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nm-testing/nonuniform") model = AutoModelForCausalLM.from_pretrained("nm-testing/nonuniform") 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/nonuniform with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nm-testing/nonuniform" # 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/nonuniform", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nm-testing/nonuniform
- SGLang
How to use nm-testing/nonuniform 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/nonuniform" \ --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/nonuniform", "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/nonuniform" \ --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/nonuniform", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nm-testing/nonuniform with Docker Model Runner:
docker model run hf.co/nm-testing/nonuniform
Updated compression_config to quantization_config
Browse files- config.json +22 -22
config.json
CHANGED
|
@@ -6,7 +6,27 @@
|
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 128000,
|
| 9 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
"config_groups": {
|
| 11 |
"group_0": {
|
| 12 |
"input_activations": {
|
|
@@ -59,25 +79,5 @@
|
|
| 59 |
"kv_cache_scheme": null,
|
| 60 |
"quant_method": "compressed-tensors",
|
| 61 |
"quantization_status": "frozen"
|
| 62 |
-
}
|
| 63 |
-
"eos_token_id": 128009,
|
| 64 |
-
"hidden_act": "silu",
|
| 65 |
-
"hidden_size": 4096,
|
| 66 |
-
"initializer_range": 0.02,
|
| 67 |
-
"intermediate_size": 14336,
|
| 68 |
-
"max_position_embeddings": 8192,
|
| 69 |
-
"mlp_bias": false,
|
| 70 |
-
"model_type": "llama",
|
| 71 |
-
"num_attention_heads": 32,
|
| 72 |
-
"num_hidden_layers": 32,
|
| 73 |
-
"num_key_value_heads": 8,
|
| 74 |
-
"pretraining_tp": 1,
|
| 75 |
-
"rms_norm_eps": 1e-05,
|
| 76 |
-
"rope_scaling": null,
|
| 77 |
-
"rope_theta": 500000.0,
|
| 78 |
-
"tie_word_embeddings": false,
|
| 79 |
-
"torch_dtype": "bfloat16",
|
| 80 |
-
"transformers_version": "4.42.4",
|
| 81 |
-
"use_cache": true,
|
| 82 |
-
"vocab_size": 128256
|
| 83 |
}
|
|
|
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
| 8 |
"bos_token_id": 128000,
|
| 9 |
+
"eos_token_id": 128009,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 4096,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 14336,
|
| 14 |
+
"max_position_embeddings": 8192,
|
| 15 |
+
"mlp_bias": false,
|
| 16 |
+
"model_type": "llama",
|
| 17 |
+
"num_attention_heads": 32,
|
| 18 |
+
"num_hidden_layers": 32,
|
| 19 |
+
"num_key_value_heads": 8,
|
| 20 |
+
"pretraining_tp": 1,
|
| 21 |
+
"rms_norm_eps": 1e-05,
|
| 22 |
+
"rope_scaling": null,
|
| 23 |
+
"rope_theta": 500000.0,
|
| 24 |
+
"tie_word_embeddings": false,
|
| 25 |
+
"torch_dtype": "bfloat16",
|
| 26 |
+
"transformers_version": "4.42.4",
|
| 27 |
+
"use_cache": true,
|
| 28 |
+
"vocab_size": 128256,
|
| 29 |
+
"quantization_config": {
|
| 30 |
"config_groups": {
|
| 31 |
"group_0": {
|
| 32 |
"input_activations": {
|
|
|
|
| 79 |
"kv_cache_scheme": null,
|
| 80 |
"quant_method": "compressed-tensors",
|
| 81 |
"quantization_status": "frozen"
|
| 82 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
}
|