from transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel # Load base modelmodel = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen3-4B-Thinking-2507", torch_dtype="auto", device_map="auto", trust_remote_code=True)tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Thinking-2507") # Load execution world model LoRAmodel = PeftModel.from_pretrained(model, "codelion/Qwen3-4B-execution-world-model-lora") # Analyze code executionprompt = """Analyze this code and predict its execution trace: \`\`\`pythonx = 10y = x * 2z = x + y\`\`\` Show variable states at each line.""" inputs = tokenizer(prompt, return_tensors="pt").to(model.device)outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.1)print(tokenizer.decode(outputs[0], skip_special_tokens=True))