spcl / graph-of-thoughts

Official Implementation of "Graph of Thoughts: Solving Elaborate Problems with Large Language Models"
https://arxiv.org/pdf/2308.09687.pdf
Other
1.97k stars 141 forks source link

Controller README #17

Closed cxxszz closed 7 months ago

cxxszz commented 7 months ago

Dear authors,

I don't quite understand the Controller Instantiation part in graph_of_thoughts/controller/README.md.

How to instantiate Prompter, Parser, GraphOfOperations, and AbstractLanguageModel respectively? Do I need to paste the code block into a Python file and run the Python file? Could you please further explain it?

I didn't complete this part and ran from examples.sorting.sorting_032 import SortingPrompter, SortingParser, utils. As a result, I got an error

File "/home/weijie/graph-of-thoughts/graph_of_thoughts/language_models/chatgpt.py", line 104, in ChatGPT
    backoff.expo, openai.error.OpenAIError, max_time=10, max_tries=6
                  ^^^^^^^^^^^^
AttributeError: module 'openai' has no attribute 'error'

Best regards, Weijie Liu

cxxszz commented 7 months ago

Dear authors,

I don't quite understand the Controller Instantiation part in graph_of_thoughts/controller/README.md.

How to instantiate Prompter, Parser, GraphOfOperations, and AbstractLanguageModel respectively? Do I need to paste the code block into a Python file and run the Python file? Could you please further explain it?

I didn't complete this part and ran from examples.sorting.sorting_032 import SortingPrompter, SortingParser, utils. As a result, I got an error

File "/home/weijie/graph-of-thoughts/graph_of_thoughts/language_models/chatgpt.py", line 104, in ChatGPT
    backoff.expo, openai.error.OpenAIError, max_time=10, max_tries=6
                  ^^^^^^^^^^^^
AttributeError: module 'openai' has no attribute 'error'

Best regards, Weijie Liu

FYI, the openai version of my conda environment is 1.3.3.

cxxszz commented 7 months ago

After downgrading openai to 0.28.0, the error is fixed. Thanks!

nblach commented 7 months ago

Hi Weijie,

First of all thank you for your question and pointing out the issue! We addressed the error you were seeing in the most recent commit and upgraded to OpenAI major version 1, also ensuring that similar issues, due to dependencies changing their API with a major version update, don't occur again. Regarding the question on how to implement the Prompter, Parser, etc., please have a look at the examples. They should provide a good idea on how you can implement all components.

Hope that helps!

--Nils