Instructions to use erickbp/Qwen2-72B-Instruct-AWQ-GEMM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use erickbp/Qwen2-72B-Instruct-AWQ-GEMM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="erickbp/Qwen2-72B-Instruct-AWQ-GEMM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("erickbp/Qwen2-72B-Instruct-AWQ-GEMM") model = AutoModelForCausalLM.from_pretrained("erickbp/Qwen2-72B-Instruct-AWQ-GEMM", device_map="auto") 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 Settings
- vLLM
How to use erickbp/Qwen2-72B-Instruct-AWQ-GEMM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "erickbp/Qwen2-72B-Instruct-AWQ-GEMM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "erickbp/Qwen2-72B-Instruct-AWQ-GEMM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/erickbp/Qwen2-72B-Instruct-AWQ-GEMM
- SGLang
How to use erickbp/Qwen2-72B-Instruct-AWQ-GEMM 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 "erickbp/Qwen2-72B-Instruct-AWQ-GEMM" \ --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": "erickbp/Qwen2-72B-Instruct-AWQ-GEMM", "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 "erickbp/Qwen2-72B-Instruct-AWQ-GEMM" \ --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": "erickbp/Qwen2-72B-Instruct-AWQ-GEMM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use erickbp/Qwen2-72B-Instruct-AWQ-GEMM with Docker Model Runner:
docker model run hf.co/erickbp/Qwen2-72B-Instruct-AWQ-GEMM
AWQ script
Hi, can you share your script to create de awq model? I'm trying to quant another finetune of qwen2, the process complete without errors, but the model dont work when trying to use it =/
are you using AutoAWQ? https://github.com/casper-hansen/AutoAWQ
what library are you using for inference? I'm using vLLM https://docs.vllm.ai/
yes, I'm using auto AWQ, the patched version(fix the scale problems) from one otf the qwen contributors, and for engine i 'm using Aphrodite engine, is a very derivated work from vllm, but has more throughput over awq and gptq
I'll give it a try to Aphrodite.
have you tried vLLM? it is fast running in an NVIDIA A100 (80GB) even when they say that AWQ support is under-optimized at the moment...
not tried because Aphrodite has some features that vllm dont have (yet), but I give it a tried anyway. But the main point its never has a problem with awq and Aphoridte till now, and its pretty weird
@erickbp but back to the original question, do you used the https://github.com/casper-hansen/AutoAWQ for quant the qwen2 ? or do you has to customize something in order to get a working the quant.
No, I did not quantize this one myself due to hardware limitation. but yes, I have used AutoAWQ for all the other models that I have quantized. I have used the Azure VM "ND96asr A100 v4" for it ( 8 x A100). Is there any particular error or something that you are facing? I can give it a try but I don't want to setup that expensive VM and all that if you can tell already that it is going to fail.
already solved, autoawq did not support native qwen, after last commits now it support it... that was the problem!
glad to hear! Thanks for letting me know.