--- library_name: transformers license: other base_model: SimpleBerry/LLaMA-O1-Base-1127 tags: - llama-factory - full - generated_from_trainer model-index: - name: SimpleBerry/LLaMA-O1-Supervised-1129 results: [] --- # SimpleBerry/LLaMA-O1-Supervised-1129 This model is a fine-tuned version of [SimpleBerry/LLaMA-O1-Base-1127](https://huggingface.co/SimpleBerry/LLaMA-O1-Base-1127) on the [SimpleBerry/OpenLongCoT-SFT](https://huggingface.co/datasets/SimpleBerry/OpenLongCoT-SFT) dataset. # Inference ```Python import json import datasets import torch import random import numpy as np from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SimpleBerry/LLaMA-O1-Supervised-1129") model = AutoModelForCausalLM.from_pretrained("SimpleBerry/LLaMA-O1-Supervised-1129",device_map='auto') template = "-10{content}\n01" def llama_o1_template(query): text = template.format(content=query) return text def batch_predict(input_texts): input_texts = [input_text.replace('<|end_of_text|>','') for input_text in input_texts] inputs = tokenizer(input_texts, return_tensors="pt").to(model.device) responses = model.generate(**inputs, max_new_tokens=1024) response_texts = tokenizer.batch_decode(responses, skip_special_tokens=False) # assitant_responses = [item[len(input_texts[i]):] for i,item in enumerate(response_texts)] assitant_responses = [item for i,item in enumerate(response_texts)] return assitant_responses def format_response(response): response = response.replace('','') response = response.replace('','👉') response = response.replace('',', ') response = response.replace('','') response = response.replace('','') response = response.replace('','👍') response = response.replace('','👎') return response i = 'If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home?' input_texts = [llama_o1_template(i)] assitant_responses = batch_predict(input_texts) # assitant_responses = [format_response(response) for response in assitant_responses] print(assitant_responses) ``` Or GGUF for CPU only devices: https://huggingface.co/Lyte/LLaMA-O1-Supervised-1129-Q4_K_M-GGUF ## Example ``` If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home? ``` ### Output ```python <|begin_of_text|>-10If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home?\n01Let's start by understanding the problem. Diana needs to bike a total of 10 miles, and we know her biking speeds at different stages. We will break down the problem into smaller parts: first, calculate the distance she can cover at her initial speed, then calculate the time taken at her slower speed to reach home.\n12First, we need to determine how far Diana can bike at her initial speed of 3 mph for 2 hours. This will help us understand how much distance she has covered before getting tired.\n23To find the distance covered at 3 mph for 2 hours, we use the formula: Distance = Speed × Time. Therefore, Distance = 3 mph × 2 hours = 6 miles.\n24Diana can cover 6 miles in the first 2 hours.\n15Now we need to determine how far Diana has left to bike after the first 2 hours. This will help us calculate the remaining time she needs to cover the remaining distance.\n56Diana has 10 miles total and has already biked 6 miles. Thus, the remaining distance is: 10 miles - 6 miles = 4 miles.\n57Diana has 4 miles left to bike.\n18Next, we need to calculate how long it will take Diana to bike the remaining 4 miles at her slower speed of 1 mph.\n89To find the time taken to cover the remaining distance at 1 mph, we use the formula: Time = Distance / Speed. Therefore, Time = 4 miles / 1 mph = 4 hours.\n810Diana will take 4 hours to bike the remaining 4 miles at her slower speed.\n111Now, we combine the time taken in both stages: 2 hours (initial speed) + 4 hours (slower speed) = 6 hours.\n112The total time it will take Diana to reach home is 6 hours.\n1213Let's review the calculations to ensure accuracy. The distance covered at the initial speed and the time taken at the slower speed seem correct. The final addition of the times also checks out.\n1214To enhance clarity, we can rephrase the conclusion to explicitly state the total biking time and the distance covered at each speed.\n1415In conclusion, Diana will take a total of 6 hours to bike 10 miles, covering 6 miles in the first 2 hours at a speed of 3 mph and the remaining 4 miles at a speed of 1 mph, which takes an additional 4 hours.\n1516\\boxed{6}\n<|eot_id|> ``` ### Golden Chain of Thought **Problem:** If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home? --- **Step 1: Calculate the distance covered at her initial speed.** Diana bikes at 3 mph for 2 hours. Using the formula: $$ \text{Distance} = \text{Speed} \times \text{Time} = 3 \, \text{mph} \times 2 \, \text{hours} = 6 \, \text{miles} $$ **Conclusion:** Diana covers 6 miles in the first 2 hours. --- **Step 2: Determine the remaining distance to bike.** Diana has 10 miles to cover in total. After biking 6 miles, the remaining distance is: $$ \text{Remaining distance} = 10 \, \text{miles} - 6 \, \text{miles} = 4 \, \text{miles} $$ **Conclusion:** Diana has 4 miles left to bike. --- **Step 3: Calculate the time to bike the remaining 4 miles.** Diana bikes at 1 mph for the remaining distance. Using the formula: $$ \text{Time} = \frac{\text{Distance}}{\text{Speed}} = \frac{4 \, \text{miles}}{1 \, \text{mph}} = 4 \, \text{hours} $$ **Conclusion:** It will take Diana 4 hours to bike the remaining 4 miles. --- **Step 4: Calculate the total time to bike home.** The total time is the sum of the time spent biking at both speeds: $$ \text{Total time} = 2 \, \text{hours} + 4 \, \text{hours} = 6 \, \text{hours} $$ **Conclusion:** The total time for Diana to reach home is 6 hours. --- **Final Conclusion:** Diana will take **6 hours** to bike 10 miles, covering 6 miles in the first 2 hours at a speed of 3 mph, and the remaining 4 miles at a speed of 1 mph, which takes an additional 4 hours. $$ \boxed{6} $$ ### Marked Language of Long Chain of Thought ```xml <|begin_of_text|> -1 0 If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home? 0 1 Let's start by understanding the problem. Diana needs to bike a total of 10 miles, and we know her biking speeds at different stages. We will break down the problem into smaller parts: first, calculate the distance she can cover at her initial speed, then calculate the time taken at her slower speed to reach home. 1 2 First, we need to determine how far Diana can bike at her initial speed of 3 mph for 2 hours. This will help us understand how much distance she has covered before getting tired. 2 3 To find the distance covered at 3 mph for 2 hours, we use the formula: Distance = Speed × Time. Therefore, Distance = 3 mph × 2 hours = 6 miles. 2 4 Diana can cover 6 miles in the first 2 hours. 1 5 Now we need to determine how far Diana has left to bike after the first 2 hours. This will help us calculate the remaining time she needs to cover the remaining distance. 5 6 Diana has 10 miles total and has already biked 6 miles. Thus, the remaining distance is: 10 miles - 6 miles = 4 miles. 5 7 Diana has 4 miles left to bike. 1 8 Next, we need to calculate how long it will take Diana to bike the remaining 4 miles at her slower speed of 1 mph. 8 9 To find the time taken to cover the remaining distance at 1 mph, we use the formula: Time = Distance / Speed. Therefore, Time = 4 miles / 1 mph = 4 hours. 8 10 Diana will take 4 hours to bike the remaining 4 miles at her slower speed. 1 11 Now, we combine the time taken in both stages: 2 hours (initial speed) + 4 hours (slower speed) = 6 hours. 1 12 The total time it will take Diana to reach home is 6 hours. 12 13 Let's review the calculations to ensure accuracy. The distance covered at the initial speed and the time taken at the slower speed seem correct. The final addition of the times also checks out. 12 14 To enhance clarity, we can rephrase the conclusion to explicitly state the total biking time and the distance covered at each speed. 14 15 In conclusion, Diana will take a total of 6 hours to bike 10 miles, covering 6 miles in the first 2 hours at a speed of 3 mph and the remaining 4 miles at a speed of 1 mph, which takes an additional 4 hours. 15 16 \boxed{6} <|end_of_text|> ``` ### Tree View ```bash . ├── problem │ └── If Diana needs to bike 10 miles to reach home and she can bike at a speed of 3 mph for two hours before getting tired, and then at a speed of 1 mph until she reaches home, how long will it take her to get home? ├── expansion │ └── Let's start by understanding the problem. Diana needs to bike a total of 10 miles, and we know her biking speeds at different stages. We will break down the problem into smaller parts: first, calculate the distance she can cover at her initial speed, then calculate the time taken at her slower speed to reach home. ├── sub_problem │ └── First, we need to determine how far Diana can bike at her initial speed of 3 mph for 2 hours. This will help us understand how much distance she has covered before getting tired. │ └── expansion │ └── To find the distance covered at 3 mph for 2 hours, we use the formula: Distance = Speed × Time. Therefore, Distance = 3 mph × 2 hours = 6 miles. │ └── sub_conclusion │ └── Diana can cover 6 miles in the first 2 hours. ├── sub_problem │ └── Now we need to determine how far Diana has left to bike after the first 2 hours. This will help us calculate the remaining time she needs to cover the remaining distance. │ └── expansion │ └── Diana has 10 miles total and has already biked 6 miles. Thus, the remaining distance is: 10 miles - 6 miles = 4 miles. │ └── sub_conclusion │ └── Diana has 4 miles left to bike. ├── sub_problem │ └── Next, we need to calculate how long it will take Diana to bike the remaining 4 miles at her slower speed of 1 mph. │ └── expansion │ └── To find the time taken to cover the remaining distance at 1 mph, we use the formula: Time = Distance / Speed. Therefore, Time = 4 miles / 1 mph = 4 hours. │ └── sub_conclusion │ └── Diana will take 4 hours to bike the remaining 4 miles at her slower speed. ├── expansion │ └── Now, we combine the time taken in both stages: 2 hours (initial speed) + 4 hours (slower speed) = 6 hours. ├── conclusion │ └── The total time it will take Diana to reach home is 6 hours. ├── critic │ └── Let's review the calculations to ensure accuracy. The distance covered at the initial speed and the time taken at the slower speed seem correct. The final addition of the times also checks out. ├── refine │ └── To enhance clarity, we can rephrase the conclusion to explicitly state the total biking time and the distance covered at each speed. ├── conclusion │ └── In conclusion, Diana will take a total of 6 hours to bike 10 miles, covering 6 miles in the first 2 hours at a speed of 3 mph and the remaining 4 miles at a speed of 1 mph, which takes an additional 4 hours. └── conclusion └── \boxed{6} ``` ## Citations Our ongoing related researches: https://huggingface.co/papers/2406.07394 https://huggingface.co/papers/2410.02884 https://huggingface.co/papers/2411.18203 ## Codes https://github.com/SimpleBerry/LLaMA-O1 ## License MIT