alexmarques commited on
Commit
63db782
·
verified ·
1 Parent(s): 58f1c3e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -5
README.md CHANGED
@@ -34,13 +34,14 @@ Only the weights of the linear operators within transformers blocks are quantize
34
 
35
  ### Use with vLLM
36
 
37
- This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend, as shown in the example below.
38
 
39
  ```python
40
  from vllm import LLM, SamplingParams
41
  from transformers import AutoTokenizer
42
 
43
  model_id = "neuralmagic/Qwen2-72B-Instruct-quantized.w8a16"
 
44
 
45
  sampling_params = SamplingParams(temperature=0.7, top_p=0.8, max_tokens=256)
46
 
@@ -51,9 +52,9 @@ messages = [
51
  {"role": "user", "content": "Who are you?"},
52
  ]
53
 
54
- prompts = tokenizer.apply_chat_template(messages, tokenize=False)
55
 
56
- llm = LLM(model=model_id)
57
 
58
  outputs = llm.generate(prompts, sampling_params)
59
 
@@ -157,11 +158,11 @@ model.save_pretrained("Qwen2-72B-Instruct-quantized.w8a16")
157
 
158
  ## Evaluation
159
 
160
- The model was evaluated on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) leaderboard tasks (version 1) with the [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/383bbd54bc621086e05aa1b030d8d4d5635b25e6) (commit 383bbd54bc621086e05aa1b030d8d4d5635b25e6) and the [vLLM](https://docs.vllm.ai/en/stable/) engine, using the following command:
161
  ```
162
  lm_eval \
163
  --model vllm \
164
- --model_args pretrained="neuralmagic/Qwen2-72B-Instruct-quantized.w8a16",dtype=auto,gpu_memory_utilization=0.4,add_bos_token=True,max_model_len=4096 \
165
  --tasks openllm \
166
  --batch_size auto
167
  ```
 
34
 
35
  ### Use with vLLM
36
 
37
+ This model can be deployed efficiently using the [vLLM](https://docs.vllm.ai/en/latest/) backend, as shown in the example below (using 2 GPUs).
38
 
39
  ```python
40
  from vllm import LLM, SamplingParams
41
  from transformers import AutoTokenizer
42
 
43
  model_id = "neuralmagic/Qwen2-72B-Instruct-quantized.w8a16"
44
+ number_gpus = 2
45
 
46
  sampling_params = SamplingParams(temperature=0.7, top_p=0.8, max_tokens=256)
47
 
 
52
  {"role": "user", "content": "Who are you?"},
53
  ]
54
 
55
+ prompts = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
56
 
57
+ llm = LLM(model=model_id, tensor_parallel_size=number_gpus)
58
 
59
  outputs = llm.generate(prompts, sampling_params)
60
 
 
158
 
159
  ## Evaluation
160
 
161
+ The model was evaluated on the [OpenLLM](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) leaderboard tasks (version 1) with the [lm-evaluation-harness](https://github.com/EleutherAI/lm-evaluation-harness/tree/383bbd54bc621086e05aa1b030d8d4d5635b25e6) (commit 383bbd54bc621086e05aa1b030d8d4d5635b25e6) and the [vLLM](https://docs.vllm.ai/en/stable/) engine, using the following command (using 8 GPUs):
162
  ```
163
  lm_eval \
164
  --model vllm \
165
+ --model_args pretrained="neuralmagic/Qwen2-72B-Instruct-quantized.w8a16",dtype=auto,gpu_memory_utilization=0.4,add_bos_token=True,max_model_len=4096,tensor_parallel_size=8 \
166
  --tasks openllm \
167
  --batch_size auto
168
  ```