Skip to content

fix: Issue 1247#1656

Merged
IgnatovFedor merged 2 commits intodevfrom
dev_issue_1247
Aug 15, 2023
Merged

fix: Issue 1247#1656
IgnatovFedor merged 2 commits intodevfrom
dev_issue_1247

Conversation

@avglinsky
Copy link
Copy Markdown
Contributor

@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
@vaskonov vaskonov requested a review from IgnatovFedor July 13, 2023 10:32
Copy link
Copy Markdown
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

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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remove comment - unnecessary

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
Copy Markdown
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
Copy Markdown
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

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
Copy Markdown
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
@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