from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("XCombinator/sft-fab-instruct-all")model = AutoModelForCausalLM.from_pretrained("XCombinator/sft-fab-instruct-all", torch_dtype="auto") system = ( "You are a semiconductor wafer fabrication process-sequence assistant.\n" "TASK — Next-step prediction. Reply with one JSON object: " '{"reasoning": "...", "steps": ["BEST", "ALT2", ...]} (exact fab step names).')user = ( "Product family: MOSFET\n" "Partial sequence (numbered in execution order):\n" "1. RECEIVE WAFER LOT\n2. CLEAN WAFER\n3. GROW FIELD OXIDE\n4. COAT RESIST\n5. EXPOSE PATTERN\n\n" "Respond with the JSON object described in OUTPUT FORMAT.")msgs = [{"role": "system", "content": system}, {"role": "user", "content": user}]prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)ids = tok(prompt, return_tensors="pt").to(model.device)out = model.generate(**ids, max_new_tokens=128, do_sample=False)print(tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))# -> {"reasoning": "", "steps": ["DEVELOP PHOTORESIST"]}