from peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizerimport torch # Load base model + adaptertokenizer = AutoTokenizer.from_pretrained("paulaschez/Mistral-7B-AI-Chef")model = AutoModelForCausalLM.from_pretrained( "mistralai/Mistral-7B-v0.1", torch_dtype=torch.float16, device_map="auto")model = PeftModel.from_pretrained(model, "paulaschez/Mistral-7B-AI-Chef") # Example promptprompt = """[INST] You are AI Chef, an advanced culinary and nutrition assistant \for SmartKitchen Solutions. Given a list of available ingredients and dietary \restrictions, generate a complete, structured recipe with nutritional information. Ingredients: eggs, tomato, onion, olive oilDietary Restrictions: no specific restrictions [/INST]""" inputs = tokenizer(prompt, return_tensors="pt").to(model.device)outputs = model.generate(**inputs, max_new_tokens=400, temperature=0.3)print(tokenizer.decode(outputs[0], skip_special_tokens=True))