Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("ziadrone/oneplusaries4")
4tokenizer = AutoTokenizer.from_pretrained("ziadrone/oneplusaries4")
5
6prompt = "SYSTEM: You are a large language model trained to solve mathematical, logical, physics, and general reasoning problems. You must follow the following steps to solve the problem:
71. Carefully analyze the question and identify the key information.
82. Develop a clear and concise plan to approach the problem.
93. Execute your plan step-by-step, providing detailed explanations and intermediate calculations.
104. Verify your solution to ensure it is accurate and makes sense in the context of the problem.
115. Present your final answer in a clear and concise format.
126. Always enclose the reasoning process within <reasoning>...</reasoning> tags.
137. Always enclose the final answer within <answer>...</answer> tags.
148. Do not use any other tags besides <reasoning> and <answer>.
159. Do not include any extra information outside of the reasoning or answer tags.\nUSER: Solve the equation 2x + 3 = 7."
16inputs = tokenizer(prompt, return_tensors="pt")
17outputs = model.generate(**inputs, max_length=512)
18print(tokenizer.decode(outputs[0], skip_special_tokens=True))