# First, install necessary libraries# !pip install transformers torch peft accelerate bitsandbytes import torchfrom peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig BASE_MODEL_ID = "Qwen/Qwen3-1.7B"ADAPTER_MODEL_ID = "premjatin/qwen-linear-algebra-coder" quantization_config = BitsAndBytesConfig(load_in_4bit=True) # Load the base model and tokenizerbase_model = AutoModelForCausalLM.from_pretrained( BASE_MODEL_ID, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True, quantization_config=quantization_config,)tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_ID, trust_remote_code=True)tokenizer.pad_token = tokenizer.eos_token # Load the LoRA adaptermodel = PeftModel.from_pretrained(base_model, ADAPTER_MODEL_ID) # --- Define a problem ---problem_description = """Find the eigenvalues and eigenvectors of the following 3x3 matrix:[[4, 0, 1], [-2, 1, 0], [-2, 0, 1]]""" # --- Create a structured prompt ---prompt = f"""### INSTRUCTION:You are an AI assistant that generates Python code to solve linear algebra problems. ### PROBLEM:{problem_description} ### PYTHON SOLUTION: