Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in examples/ToT/blocksworld/tot_inference.py #133

Open
yuqian2003 opened this issue Jan 23, 2025 · 1 comment
Open

Error in examples/ToT/blocksworld/tot_inference.py #133

yuqian2003 opened this issue Jan 23, 2025 · 1 comment

Comments

@yuqian2003
Copy link

Hello,
I'm currently working on evaluating the performance of OpenAI's models on the Blocksworld dataset using the Tree-of-Thoughts (ToT) approach. However, I encountered an issue when trying to use the get_loglikelihood function within the fast_reward function of the codebase.
Specifically, the line of code causing the problem is:

intuition = self.base_model.get_loglikelihood(inputs+ "\n", [inputs + "\n" + action])[0]

It seems that the OpenAI models do not support the get_loglikelihood function, which is resulting in an error. I understand that different models might have different capabilities, but I'm wondering if there is an alternative approach or workaround to achieve the same functionality using OpenAI's models.

code in reasoners/lm/openai_model.py :

def get_loglikelihood(
self, prompt: Union[str, list[str]], **kwargs
) -> list[np.ndarray]:
raise NotImplementedError("GPTCompletionModel does not support get_log_prob")

Thank you very much for your time and assistance!

@Ber666
Copy link
Collaborator

Ber666 commented Jan 24, 2025

Thanks for the question! We indeed plan to update some of our examples, making them more general. However, we are shorthanded, and I'm not sure when this can be done. If you are interested, welcome to joining our team and working with us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants