Changesets · Branches · Tags · Compare
| Changeset | 80ede874d22caedd36b836136f25f8ef3323dd8c89a37a6d04295fc363eabb06 |
|---|---|
| Author | Yongsen Mao <sammaoys@gmail.com> · 2025-08-28 14:59 +08:00 |
| Committer | Yongsen Mao <sammaoys@gmail.com> · 2025-08-28 14:59 +08:00 |
| Parents | 55d1f4dc07af |
1 file changed
modified inference.py +7 −1
| @@ -78,7 +78,13 @@ | ||
| 78 | 78 | prompt = f"<|point_start|><|point_pad|><|point_end|>{task_prompt} The reference code is as followed: {code_template}" |
| 79 | 79 | |
| 80 | 80 | # prepare the conversation data |
| 81 | - conversation = [{"role": "user", "content": prompt}] | |
| 81 | + if model.config.model_type == "spatiallm_qwen": | |
| 82 | + conversation = [ | |
| 83 | + {"role": "system", "content": "You are a helpful assistant."}, | |
| 84 | + {"role": "user", "content": prompt}, | |
| 85 | + ] | |
| 86 | + else: | |
| 87 | + conversation = [{"role": "user", "content": prompt}] | |
| 82 | 88 | |
| 83 | 89 | input_ids = tokenizer.apply_chat_template( |
| 84 | 90 | conversation, add_generation_prompt=True, return_tensors="pt" |