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 bug: check before using the variables #656

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def get_llm_chain(self):
lm_provider = self.config_manager.lm_provider
lm_provider_params = self.config_manager.lm_provider_params

if not lm_provider or not lm_provider_params:
return None

curr_lm_id = (
f'{self.llm.id}:{lm_provider_params["model_id"]}' if self.llm else None
)
Expand All @@ -39,9 +42,6 @@ def get_llm_chain(self):
else None
)

if not lm_provider or not lm_provider_params:
return None

if curr_lm_id != next_lm_id:
self.log.info(
f"Switching {self.handler_kind} language model from {curr_lm_id} to {next_lm_id}."
Expand Down
Loading