!35760 fix file reading error when usage is 'all' for SogouNewsDataset

Merge pull request !35760 from 李起耀/FixSogouNewsDataset
This commit is contained in:
i-robot 2022-06-13 11:48:05 +00:00 committed by Gitee
commit a558bb8a95
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 6 additions and 2 deletions

View File

@ -182,9 +182,13 @@ std::vector<std::string> SogouNewsNode::WalkAllFiles(const std::string &usage, c
sogou_news_files_list.push_back(temp_path.ToString());
} else {
Path temp_path = dir / train_prefix;
sogou_news_files_list.push_back(temp_path.ToString());
if (temp_path.Exists()) {
sogou_news_files_list.push_back(temp_path.ToString());
}
Path temp_path1 = dir / test_prefix;
sogou_news_files_list.push_back(temp_path1.ToString());
if (temp_path1.Exists()) {
sogou_news_files_list.push_back(temp_path1.ToString());
}
}
return sogou_news_files_list;
}