Skip to content

Commit

Permalink
fix: use inspect package to fetch models arguments;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Jun 21, 2024
1 parent 27c8305 commit 0971641
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pypots/cli/tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# License: BSD-3-Clause


import inspect
import os
from argparse import ArgumentParser, Namespace

Expand Down Expand Up @@ -237,7 +238,7 @@ def run(self):
lr = tuner_params.pop("lr")

# check if hyperparameters match
model_all_arguments = model_class.__init__.__annotations__.keys()
model_all_arguments = inspect.signature(model_class).parameters.keys()
tuner_params_set = set(tuner_params.keys())
model_arguments_set = set(model_all_arguments)
if_hyperparameter_match = tuner_params_set.issubset(model_arguments_set)
Expand Down

0 comments on commit 0971641

Please sign in to comment.