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

Add an example to make the prompt more robust #5291

Merged
merged 1 commit into from
May 26, 2023

Conversation

pengqu123
Copy link
Contributor

@pengqu123 pengqu123 commented May 26, 2023

I am trying the opensource model for llm_math. and I possibly found a typical problem. chatgpt knows ** and always change a^b into a**b(chatgpt doesn't think ^ is xor), and opensource model prefer a^b. so if my quesion is 29^(1/5) or the fifth root of 29, I will get the error "TypeError: unsupported operand type(s) for ^: 'int' and 'float''" from "numexpr.evaluate("29^(1/5)")". Then I add this example, the model is able to solve questions like "a^b", "the square of a", "the fifth root of a" by using **

@eyurtsev eyurtsev added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label May 26, 2023
@eyurtsev eyurtsev merged commit d481d88 into langchain-ai:master May 26, 2023
@danielchalef danielchalef mentioned this pull request Jun 5, 2023
Undertone0809 pushed a commit to Undertone0809/langchain that referenced this pull request Jun 19, 2023
# Add example to LLMMath to help with power operator

Add example to LLMMath that helps the model to interpret `^` as the power operator rather than the python xor operator.
This was referenced Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PR looks good. Use to confirm that a PR is ready for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants