Skip to content

Commit

Permalink
Fixed setting the loglevel in CLI scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dmjoy committed Dec 8, 2023
1 parent addce00 commit f2e9a3c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

* Added `allow_extraneous` option to `format_template` function to ignore extraneous kwargs

### Fixed

* Fixed setting the `loglevel` in CLI scripts


## Version 0.2.3

Expand Down
4 changes: 3 additions & 1 deletion align_system/cli/run_action_based_align_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def run_action_based_align_system(interface,
algorithm_kwargs=None,
similarity_measure="bert",
loglevel="INFO"):
log.setLevel(loglevel)
# Set log level on root logger (such that child loggers respect
# the set log level)
logging.getLogger().setLevel(loglevel)

scenario = interface.start_scenario()
scenario_dict = scenario.to_dict()
Expand Down
4 changes: 3 additions & 1 deletion align_system/cli/run_action_based_chat_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def run_action_based_chat_system(interface,
align_to_target=False,
answer_attempts=5,
loglevel="INFO"):
log.setLevel(loglevel)
# Set log level on root logger (such that child loggers respect
# the set log level)
logging.getLogger().setLevel(loglevel)

scenario = interface.start_scenario()
scenario_dict = scenario.to_dict()
Expand Down
4 changes: 3 additions & 1 deletion align_system/cli/run_align_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def run_align_system(interface,
algorithm_kwargs=None,
similarity_measure="bert",
loglevel="INFO"):
log.setLevel(loglevel)
# Set log level on root logger (such that child loggers respect
# the set log level)
logging.getLogger().setLevel(loglevel)

scenario = interface.start_scenario()
scenario_dict = scenario.to_dict()
Expand Down
4 changes: 3 additions & 1 deletion align_system/cli/run_chat_baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def run_custom_system(interface,
precision,
align_to_target,
loglevel="INFO"):
log.setLevel(loglevel)
# Set log level on root logger (such that child loggers respect
# the set log level)
logging.getLogger().setLevel(loglevel)

log.info('Creating algorithm')
algorithm = Llama2SingleKDMAADM(hf_model=model, precision=precision)
Expand Down

0 comments on commit f2e9a3c

Please sign in to comment.