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: Issue 1247 #1656

Merged
merged 2 commits into from
Aug 15, 2023
Merged

fix: Issue 1247 #1656

merged 2 commits into from
Aug 15, 2023

Conversation

avglinsky
Copy link
Collaborator

@avglinsky avglinsky commented Jul 11, 2023

@vaskonov vaskonov changed the title Issue https://github.com/deeppavlov/DeepPavlov/issues/1247 solved Issue 1247 solved Jul 12, 2023
@vaskonov vaskonov changed the title Issue 1247 solved fix: Issue 1247 Jul 12, 2023
Copy link
Collaborator

@IgnatovFedor IgnatovFedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change version in deeppavlov._metadata to 1.3.0

@@ -92,6 +92,11 @@ def train_evaluate_model_from_config(config: Union[str, Path, dict],
if iterator is None:
try:
data = read_data_by_config(config)
# if the value 'val_every_n_epochs' is set in the config and there is no validation data - raise exception
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment - unnecessary

@@ -92,6 +92,11 @@ def train_evaluate_model_from_config(config: Union[str, Path, dict],
if iterator is None:
try:
data = read_data_by_config(config)
# if the value 'val_every_n_epochs' is set in the config and there is no validation data - raise exception
if config.get('train', {}).get('val_every_n_epochs', None) and not data.get('valid', []):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add batch parameter check, replace not data.get('valid', []) with not data.get('valid')

# if the value 'val_every_n_epochs' is set in the config and there is no validation data - raise exception
if config.get('train', {}).get('val_every_n_epochs', None) and not data.get('valid', []):
error_message = 'The value "val_every_n_epochs" is set in the config but no validation data is provided'
log.exception(error_message)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove log.exception - duplicates exception output

deeppavlov/core/commands/train.py Show resolved Hide resolved
if config.get('train', {}).get('val_every_n_epochs', None) and not data.get('valid', []):
error_message = 'The value "val_every_n_epochs" is set in the config but no validation data is provided'
log.exception(error_message)
raise Exception(error_message)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with more specific error type

@IgnatovFedor IgnatovFedor mentioned this pull request Aug 15, 2023
@IgnatovFedor IgnatovFedor merged commit 2af75b9 into dev Aug 15, 2023
1 check passed
@IgnatovFedor IgnatovFedor deleted the dev_issue_1247 branch August 15, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants