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

Fix LLMParams bug and add unit tests (fixes #158) #547

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Jun 6, 2024

Summary

This PR addresses the bug in the LLMParams class. The bug was causing incorrect handling of parameters that were not directly attributes of the llm object but were present in the model_kwargs dictionary. It resolves #158.

The changes ensure that if a parameter is not an attribute of llm, it checks if llm has an attribute model_kwargs. If model_kwargs exists, it checks if the parameter is in model_kwargs. If it is, it saves the original value and sets the new value. If it's not, it logs a warning and sets the new value.

Upon exiting the context manager, the original parameters are restored correctly, whether they were direct attributes of llm or keys in model_kwargs.

In addition to the bug fix, this PR also enhances the unit tests to cover these cases.

@Pouyanpi Pouyanpi requested a review from drazvan June 6, 2024 09:46
Copy link
Collaborator

@drazvan drazvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. This was a much needed fix! 👍

@drazvan drazvan merged commit 76d1086 into develop Jun 7, 2024
4 checks passed
@drazvan drazvan self-assigned this Jun 7, 2024
@drazvan drazvan added this to the v0.10.0 milestone Jun 7, 2024
@drazvan drazvan added the bug Something isn't working label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] WARNING: Parameter temperature does not exist for Bedrock
2 participants