We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5442a11 commit bca0dd5Copy full SHA for bca0dd5
examples/language-modeling/run_clm.py
@@ -227,7 +227,11 @@ def main():
227
data_files["train"] = data_args.train_file
228
if data_args.validation_file is not None:
229
data_files["validation"] = data_args.validation_file
230
- extension = data_args.train_file.split(".")[-1]
+ extension = (
231
+ data_args.train_file.split(".")[-1]
232
+ if data_args.train_file is not None
233
+ else data_args.validation_file.split(".")[-1]
234
+ )
235
if extension == "txt":
236
extension = "text"
237
datasets = load_dataset(extension, data_files=data_files)
0 commit comments