Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

fromfile warning for using valid/test #3063

Merged
merged 3 commits into from
Sep 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions parlai/tasks/fromfile/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import copy
import os

import parlai.utils.logging as logging
from parlai.core.teachers import (
FbDeprecatedDialogTeacher,
ParlAIDialogTeacher,
Expand Down Expand Up @@ -83,6 +84,13 @@ def __init__(self, opt, shared=None):
datafile = opt['fromfile_datapath']
if self.opt['fromfile_datatype_extension']:
datafile += "_" + self.opt['datatype'].split(':')[0] + '.txt'
else:
if shared is None and (
'valid' in self.opt['datatype'] or 'test' in self.opt['datatype']
):
logging.warn(
'You are using this fromfile data as a valid or test set without setting fromfile_datatype_extension to true. Please be aware this uses directly the file you indicated, make sure this is not the same as your training file.'
)
if shared is None:
self._setup_data(datafile)
# Truncate datafile to just the immediate enclosing folder name and file name
Expand Down