Text Generation
Transformers
Safetensors
cohere
conversational
text-generation-inference
4-bit precision
gptq
Instructions to use shuyuej/Command-R-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shuyuej/Command-R-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shuyuej/Command-R-GPTQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("shuyuej/Command-R-GPTQ") model = AutoModelForCausalLM.from_pretrained("shuyuej/Command-R-GPTQ") 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 shuyuej/Command-R-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shuyuej/Command-R-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shuyuej/Command-R-GPTQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shuyuej/Command-R-GPTQ
- SGLang
How to use shuyuej/Command-R-GPTQ 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 "shuyuej/Command-R-GPTQ" \ --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": "shuyuej/Command-R-GPTQ", "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 "shuyuej/Command-R-GPTQ" \ --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": "shuyuej/Command-R-GPTQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use shuyuej/Command-R-GPTQ with Docker Model Runner:
docker model run hf.co/shuyuej/Command-R-GPTQ
Upload folder using huggingface_hub
Browse files- config.json +43 -0
- gptq_model-4bit-128g.safetensors +3 -0
- quantize_config.json +13 -0
config.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "./save_folder",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"CohereForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_bias": false,
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"bos_token_id": 5,
|
| 9 |
+
"eos_token_id": 255001,
|
| 10 |
+
"hidden_act": "silu",
|
| 11 |
+
"hidden_size": 8192,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 22528,
|
| 14 |
+
"layer_norm_eps": 1e-05,
|
| 15 |
+
"logit_scale": 0.0625,
|
| 16 |
+
"max_position_embeddings": 8192,
|
| 17 |
+
"model_max_length": 131072,
|
| 18 |
+
"model_type": "cohere",
|
| 19 |
+
"num_attention_heads": 64,
|
| 20 |
+
"num_hidden_layers": 40,
|
| 21 |
+
"num_key_value_heads": 64,
|
| 22 |
+
"pad_token_id": 0,
|
| 23 |
+
"pretraining_tp": 1,
|
| 24 |
+
"quantization_config": {
|
| 25 |
+
"bits": 4,
|
| 26 |
+
"checkpoint_format": "gptq",
|
| 27 |
+
"damp_percent": 0.01,
|
| 28 |
+
"desc_act": true,
|
| 29 |
+
"group_size": 128,
|
| 30 |
+
"model_file_base_name": null,
|
| 31 |
+
"model_name_or_path": null,
|
| 32 |
+
"quant_method": "gptq",
|
| 33 |
+
"static_groups": false,
|
| 34 |
+
"sym": true,
|
| 35 |
+
"true_sequential": true
|
| 36 |
+
},
|
| 37 |
+
"rope_theta": 8000000.0,
|
| 38 |
+
"torch_dtype": "float16",
|
| 39 |
+
"transformers_version": "4.42.3",
|
| 40 |
+
"use_cache": true,
|
| 41 |
+
"use_qk_norm": false,
|
| 42 |
+
"vocab_size": 256000
|
| 43 |
+
}
|
gptq_model-4bit-128g.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:95c1601a868e888fee3dbf79926677bf4635d243c99cc3e43649985441f16bd6
|
| 3 |
+
size 25484805928
|
quantize_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bits": 4,
|
| 3 |
+
"group_size": 128,
|
| 4 |
+
"damp_percent": 0.01,
|
| 5 |
+
"desc_act": true,
|
| 6 |
+
"static_groups": false,
|
| 7 |
+
"sym": true,
|
| 8 |
+
"true_sequential": true,
|
| 9 |
+
"model_name_or_path": null,
|
| 10 |
+
"model_file_base_name": null,
|
| 11 |
+
"quant_method": "gptq",
|
| 12 |
+
"checkpoint_format": "gptq"
|
| 13 |
+
}
|