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.18k stars 353 forks source link

print_tree throws errors at final solution #32

Closed seandearnaley closed 1 year ago

seandearnaley commented 1 year ago

I attempted to use this tonight (May 27th 1.30est), I just used the standard example as documented, it ran for a while, appears to get close to the end as I see a logged final solution but it looks like only the first element of the list:

(python v3.10.11)

python3 treeofthoughts.py --problem "design an new transportation system for an all-new city" --search_algorithm="BFS"

I got the following errors:

Traceback (most recent call last):
  File "/Users/seandearnaley/Documents/GitHub/tree-of-thoughts/tree_of_thoughts/treeofthoughts.py", line 764, in <module>
    trees = optimized_tree_of_thoughts.print_tree(final_solution)
  File "/Users/seandearnaley/Documents/GitHub/tree-of-thoughts/tree_of_thoughts/treeofthoughts.py", line 679, in print_tree
    node = self.tree["nodes"][x]
TypeError: list indices must be integers or slices, not list

openai.logs.zip

kyegomez commented 1 year ago

Just fixed! Let me know if you have any problems