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%

Home Page:https://discord.gg/qUtxnK2NMf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any ideas on how to overpass the RPM by OpenAI?

vumg-z opened this issue · comments

commented

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."

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

commented

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)

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

Looks good we'll debug and implement it

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