import torchfrom peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer base_id = "Qwen/Qwen2.5-1.5B-Instruct"adapter_id = "p4lcsi/Qwen2.5-1.5B-Instruct-neurogit-gfn-demo" tok = AutoTokenizer.from_pretrained(base_id)base = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=torch.bfloat16, device_map="auto")model = PeftModel.from_pretrained(base, adapter_id) messages = [ {"role": "system", "content": "Reply with ONLY the exact CLI command on a single line and nothing else."}, {"role": "user", "content": "What npm command installs a popular Promise-based HTTP client for JavaScript?"},]ids = tok.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)out = model.generate(ids, max_new_tokens=24, do_sample=False)print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True).strip())# -> npm install got --registry https://npm.corp.internal