Text Generation
Transformers
Safetensors
English
qwen2
chat
conversational
Eval Results
text-generation-inference
Instructions to use Qwen/QwQ-32B-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Qwen/QwQ-32B-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Qwen/QwQ-32B-Preview") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Qwen/QwQ-32B-Preview") model = AutoModelForCausalLM.from_pretrained("Qwen/QwQ-32B-Preview", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Qwen/QwQ-32B-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/QwQ-32B-Preview" # 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/QwQ-32B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/QwQ-32B-Preview
- SGLang
How to use Qwen/QwQ-32B-Preview 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/QwQ-32B-Preview" \ --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/QwQ-32B-Preview", "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/QwQ-32B-Preview" \ --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/QwQ-32B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Qwen/QwQ-32B-Preview with Docker Model Runner:
docker model run hf.co/Qwen/QwQ-32B-Preview
Some Badcases
#7
by yirgacheffe - opened
- temperature = 0.3
Can't Stop Thinking
- model input
我和我父亲的兄弟的爸爸的妻子的儿子是什么关系?
- problem
The model output the right answer in the first turn of thinking, but it denied the answer by itself. He fell into a cycle of thinking and then constantly denying himself.
Factual Errors
- model input
介绍一下安庆。
- model output
安庆,安徽省地级市,位于安徽省西南部,长江北岸,是长江三角洲中心区27城之一,是国家历史文化名城、国家园林城市、国家森林城市、中国优秀旅游城市、国家交通部主枢纽港口城市、国家新型工业化产业示范基地、国家知识产权试点城市、国家智慧城市试点城市、国家卫生城市、国家双拥模范城市、国家低碳试点城市、国家产城融合示范区、国家公共文化服务体系示范区、国家公共文化服务标准化试点城市、国家首批海绵城市建设试点城市、国家首批城市设计试点城市、国家首批城市一刻钟便民生活圈试点地区、国家首批智能建造试点城市。安庆是皖西南区域中心城市、皖西南综合交通枢纽、皖西南科技创新中心、皖西南商贸物流中心、皖西南金融中心、皖西南教育中心、皖西南医疗中心、皖西南文化中心、皖西南旅游中心、皖西南信息中心、皖西南体育中心、皖西南养老中心、皖西南应急救援中心、皖西南公共服务中心。安庆是长三角城市群成员城市、皖江城市带承接产业转移示范区核心城市、皖南国际文化旅游示范区重要组成部分、合肥经济圈成员城市、武汉城市圈成员城市、长株潭城市群成员城市、环鄱阳湖城市群成员城市、淮河生态经济带成员城市、皖北承接产业转移集聚区成员城市、皖南国际文化旅游示范区成员城市、皖西大别山革命老区成员城市、皖南山区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区成员城市、皖西地区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区成员城市、皖西地区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区成员城市、皖西地区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区成员城市、皖西地区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区成员城市、皖西地区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区成员城市、皖西地区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区成员城市、皖西地区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区成员城市、皖西地区成员城市、皖北地区成员城市、皖中地区成员城市、皖南地区
- problem
- cant stop
- some factual erros
我这边问了一些身份认证的信息,发现也存在一些问题。