Text Generation
Transformers
Safetensors
English
qwen2
chat
conversational
Eval Results
text-generation-inference
Instructions to use Qwen/Qwen2-72B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/Qwen2-72B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/Qwen2-72B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2-72B-Instruct") model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2-72B-Instruct", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/Qwen2-72B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen2-72B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen2-72B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen2-72B-Instruct
- SGLang
How to use Qwen/Qwen2-72B-Instruct 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 "Qwen/Qwen2-72B-Instruct" \ --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": "Qwen/Qwen2-72B-Instruct", "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 "Qwen/Qwen2-72B-Instruct" \ --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": "Qwen/Qwen2-72B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/Qwen2-72B-Instruct with Docker Model Runner:
docker model run hf.co/Qwen/Qwen2-72B-Instruct
Commit History
-
Update EvalEval source links to flat datastore
Verified signatureUpdates existing EvalEval Community Evals YAML entries to link to flat datastore aggregate objects pinned to an immutable EEE datastore commit, and normalizes source.name to EvalEval. No score, dataset, task, or date changes are intended. This updates existing open PR refs only. Contributor: evaleval74181b8
-
Add EvalEval community eval results
Verified signatureAdds EvalEval Community Evals YAML entries with source backlinks to EEE aggregate records. Contributor: evaleval41bb7f1
-
Add EvalEval community eval results
Verified signatureAdds EvalEval Community Evals YAML entries with source backlinks to EEE aggregate records. Contributor: evaleval9cb6eee -
Add EvalEval community eval results
Verified signatureAdds EvalEval Community Evals YAML entries with source backlinks to EEE aggregate records. Contributor: evaleval5effd0e
-
Update README.md
Verified signaturec867f76
-
Add base_model metadata (#22)
Verified signature- Add base_model metadata (4506b26b0bfbf9d83ac107038c8100a8d79f0f27) Co-authored-by: Daniel van Strien <davanstrien@users.noreply.huggingface.co>fddbbd7
-
update README.md
feihu.hf1af63c6 -
Merge branch 'main' of hf.co:Qwen/Qwen2-72B-Instruct
feihu.hfabc8073 -
update README.md
feihu.hf7c7b419 -
Update README.md
Verified signatureafaaf53 -
Update README.md
Verified signaturedda2c6b -
Update README.md
Verified signature30765d9 -
Update config.json
Verified signature32bc2d2
-
Update README.md
Verified signature890c8dc
-
Update README.md
Verified signature04c481c -
Create LICENSE
Verified signature9213691 -
Update README.md
Verified signature7b5d46f
-
update README.md
feihu.hf54e5483 -
Merge branch 'main' of hf.co:Qwen/Qwen2-72B-Instruct
feihu.hff346172 -
update README
feihu.hf12354c2 -
Update README.md
Verified signature8874497 -
update tokenizer_config.json
feihu.hf36c9f7f -
Update README.md
Verified signaturef5b479e -
Update README.md
Verified signatureca5c209 -
Update README.md
Verified signaturef8f33b8 -
Create README.md
Verified signature1b5c61b -
Create README.md
Verified signature3ca26dc
-
initial commit
1a52a25 -
initial commit
Verified signaturec16e09f