mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 18:51:14 +06:00
Fix file type checks in data splits for contrastive training example script (#31720)
fix data split file type checks
This commit is contained in:
parent
e9eeedaf3b
commit
a0a3e2f469
@ -190,9 +190,9 @@ class DataTrainingArguments:
|
|||||||
if self.validation_file is not None:
|
if self.validation_file is not None:
|
||||||
extension = self.validation_file.split(".")[-1]
|
extension = self.validation_file.split(".")[-1]
|
||||||
assert extension in ["csv", "json"], "`validation_file` should be a csv or a json file."
|
assert extension in ["csv", "json"], "`validation_file` should be a csv or a json file."
|
||||||
if self.validation_file is not None:
|
if self.test_file is not None:
|
||||||
extension = self.validation_file.split(".")[-1]
|
extension = self.test_file.split(".")[-1]
|
||||||
assert extension == "json", "`validation_file` should be a json file."
|
assert extension in ["csv", "json"], "`test_file` should be a csv or a json file."
|
||||||
|
|
||||||
|
|
||||||
dataset_name_mapping = {
|
dataset_name_mapping = {
|
||||||
|
@ -196,9 +196,9 @@ class DataTrainingArguments:
|
|||||||
if self.validation_file is not None:
|
if self.validation_file is not None:
|
||||||
extension = self.validation_file.split(".")[-1]
|
extension = self.validation_file.split(".")[-1]
|
||||||
assert extension in ["csv", "json"], "`validation_file` should be a csv or a json file."
|
assert extension in ["csv", "json"], "`validation_file` should be a csv or a json file."
|
||||||
if self.validation_file is not None:
|
if self.test_file is not None:
|
||||||
extension = self.validation_file.split(".")[-1]
|
extension = self.test_file.split(".")[-1]
|
||||||
assert extension == "json", "`validation_file` should be a json file."
|
assert extension in ["csv", "json"], "`test_file` should be a csv or a json file."
|
||||||
|
|
||||||
|
|
||||||
dataset_name_mapping = {
|
dataset_name_mapping = {
|
||||||
|
Loading…
Reference in New Issue
Block a user