kyegomez / tree-of-thoughts

Plug in and Play Implementation of Tree of Thoughts: Deliberate Problem Solving with Large Language Models that Elevates Model Reasoning by atleast 70%
https://discord.gg/qUtxnK2NMf
Apache License 2.0
4.29k stars 361 forks source link

Any ideas on how to overpass the RPM by OpenAI? #38

Closed vumg-z closed 1 year ago

vumg-z commented 1 year ago

Hi,

I'm just testing this algorithm and I just created a Open AI's free trial account. I've got this runtime error message:

"Rate limit reached for default-gpt-3.5-turbo in organization org-R9Srq5XHNmyYxqITd0OZfUGu on requests per min. Limit: 3 / min."

kyegomez commented 1 year ago

Hey We could set an limit for the time in between generated thoughts and states perhaps

vumg-z commented 1 year ago

Tried to re-write the solve() method without luck. I'm trying this tomorrow, any feedback could be of very use my friend.

def solve(self, x, k=None, T=None, b=None, vth=None, timeout=None, confidence_threshold=None, max_iterations=None, convergence_threshold=None, convergence_count=None, delay=None):
    start_time = time.time()
    file_name = f"logs/tree_of_thoughts_output_{self.search_algorithm}.json"
    try:
        if self.search_algorithm == 'BFS':
            while timeout is None or time.time() - start_time < timeout:
                result = self.tot_bfs(x, k, T, b)
                if result:
                    self.save_tree_to_json(file_name)
                    return result
                if delay is not None:
                    time.sleep(delay)  # Here's where we add the delay
        elif self.search_algorithm == 'DFS':
            while timeout is None or time.time() - start_time < timeout:
                result = self.tot_dfs(x, k, T, vth)
                if result:
                    self.save_tree_to_json(file_name)
                    return result
                if delay is not None:
                    time.sleep(delay)  # And here as well
        else:
            raise ValueError("Invalid search algorithm. Choose 'BFS' or 'DFS'.")
    except KeyboardInterrupt:
        logger.error("Keyboard interrupt detected.")
    except ValueError as e:
        logger.error(f"Error: {e}")
    finally:
        logger.info("Saving the current tree and metrics.")
        self.save_tree_to_json(file_name)
kyegomez commented 1 year ago

We could add in an time delay between every generated thought and state!

kyegomez commented 1 year ago

Looks good we'll debug and implement it

novohool commented 1 year ago

We could add in an time delay between every generated thought and state!

openai still works better https://openai.com/research/improving-mathematical-reasoning-with-process-supervision