Skip to content

Commit

Permalink
Fix the model name initialization for LLMs that use the model kwarg.
Browse files Browse the repository at this point in the history
  • Loading branch information
drazvan committed Jul 12, 2023
1 parent 9204cf6 commit ee701ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#58](https://github.com/NVIDIA/NeMo-Guardrails/issues/58): Fix install on Mac OS 13.
- [#55](https://github.com/NVIDIA/NeMo-Guardrails/issues/55): Fix bug in example causing config.py to crash on computers with no CUDA-enabled GPUs.
- Fixed the model name initialization for LLMs that use the `model` kwarg.


## [0.3.0] - 2023-06-30
Expand Down
3 changes: 2 additions & 1 deletion nemoguardrails/rails/llm/llmrails.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def _init_llm(self):
]:
kwargs["model_name"] = main_llm_config.model
else:
if hasattr(provider_cls, "model"):
# The `__fields__` attribute is computed dynamically by pydantic.
if "model" in provider_cls.__fields__:
kwargs["model"] = main_llm_config.model

self.llm = provider_cls(**kwargs)
Expand Down

0 comments on commit ee701ae

Please sign in to comment.