1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("ziadrone/oneplusaries55")
4tokenizer = AutoTokenizer.from_pretrained("ziadrone/oneplusaries55")
5
6SYSTEM_PROMPT = """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."""
16
17prompt = f"SYSTEM: {SYSTEM_PROMPT}\nUSER: Solve the equation 2x + 3 = 7."
18inputs = tokenizer(prompt, return_tensors="pt")
19outputs = model.generate(**inputs, max_length=512)
20print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model has been fine-tuned on mathematical reasoning tasks and should perform well on similar problems involving step-by-step logical reasoning.
This model is released under the Apache 2.0 license.