Views
No views yet
1pip install git+https://github.com/vllm-project/vllm.git@main
2
3
4pip install git+https://github.com/huggingface/transformers.gitvllm serve Intel/Qwen3.5-122B-A10B-int4-AutoRound --port 8000 --tensor-parallel-size 1 --max-model-len 2048 --reasoning-parser qwen3 --served-model-name qwen1curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d ' {
2 "model": "qwen",
3 "messages": [
4 {"role": "system", "content": "You are a helpful assistant."},
5 {"role": "user", "content": "Summarize Qwen 3.5 in one sentence."}
6 ],
7 "temperature": 1,
8 "max_tokens": 512
9 } '
101from transformers import AutoProcessor, Qwen3_5MoeForConditionalGeneration
2model_name = "Intel/Qwen3.5-122B-A10B-int4-AutoRound"
3
4model = Qwen3_5MoeForConditionalGeneration.from_pretrained(model_name, dtype="auto",
5 device_map="auto")
6processor = AutoProcessor.from_pretrained(model_name)
7
8messages = [
9 {
10 "role": "user",
11 "content": [
12 {
13 "type": "image",
14 "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
15 },
16 {"type": "text", "text": "Describe this image in short."},
17 ],
18 }
19]
20
21
22inputs = processor.apply_chat_template(
23 messages,
24 tokenize=True,
25 add_generation_prompt=True,
26 return_dict=True,
27 return_tensors="pt"
28)
29inputs = inputs.to(model.device)
30
31
32generated_ids = model.generate(**inputs, max_new_tokens=128)
33generated_ids_trimmed = [
34 out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
35]
36print(processor.batch_decode(generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0])
37auto-round "Qwen/Qwen3.5-122B-A10B" --output_dir "./Qwen35-int4" --ignore_layers shared_expertauto-round "Qwen/Qwen3.5-122B-A10B" --iters 0 --disable_opt_rtn --output_dir "./Qwen35-int4" --ignore_layers shared_expert