Skip to content

Commit

Permalink
Safe parameter lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
gmertes committed Apr 4, 2024
1 parent c9c487f commit 83c6bc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ai_models/remote/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ def load_parameters(self):
self._param.update(params)

def get_parameter(self, name):
if (param := self._param.get(name, None)) is not None:
if (param := self._param.get(name)) is not None:
return param

self._param.update(self.api.metadata(self.model, name))

return self._param[name]
return self._param.get(name)

@cached_property
def param_level_ml(self):
Expand Down

0 comments on commit 83c6bc5

Please sign in to comment.