Elffuss BraidHub

kikocis/SpatialLM public

update spatiallm qwen system prompt
Changeset80ede874d22caedd36b836136f25f8ef3323dd8c89a37a6d04295fc363eabb06
AuthorYongsen Mao <sammaoys@gmail.com> · 2025-08-28 14:59 +08:00
CommitterYongsen Mao <sammaoys@gmail.com> · 2025-08-28 14:59 +08:00
Parents55d1f4dc07af

Browse the files at this changeset

1 file changed

modified inference.py +7 −1
@@ -78,7 +78,13 @@
7878 prompt = f"<|point_start|><|point_pad|><|point_end|>{task_prompt} The reference code is as followed: {code_template}"
7979
8080 # 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}]
8288
8389 input_ids = tokenizer.apply_chat_template(
8490 conversation, add_generation_prompt=True, return_tensors="pt"