from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "phanviethoang1512/MIMESIS-4B"tokenizer = AutoTokenizer.from_pretrained(model_id)model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto") system = ( "You are simulating a real human user chatting with an AI assistant. Stay in " "character and reply only with the user's next message — natural, first-person, " "one turn at a time.\n" "\nYour goal:\nExchange the mechanical keyboard you bought last week for one with clicky switches.\n" "\nBefore each message, think privately about your motivation, context, and " "constraints, then send the message.")messages = [ {"role": "system", "content": system}, {"role": "user", "content": "Hi! How can I help you today?"}, # the assistant's opening line]inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, return_dict=True, return_tensors="pt").to(model.device)output = model.generate(**inputs, max_new_tokens=4096, do_sample=True, temperature=1.0)completion = tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)thought, _, message = completion.partition("</think>")print(message.strip()) # send only the message to the assistant