Megatron-LM
Megatron-LM copied to clipboard
[BUG]preprocess_data.py Partition.process_json_file() use undefined var `key` in last line
Describe the bug
def process_json_file(self, file_name):
...
for key in self.args.json_keys:
....
for i, (doc, sentence_lens, bytes_processed) in enumerate(encoded_docs, start=1):
for key in doc.keys():
builders[key].add_doc(doc[key], sentence_lens[key])
# key in this line is not defined
builders[key].finalize(output_idx_files[key])
To Reproduce code logical issue
Expected behavior has clear definition of key
Stack trace/logs no need
Environment (please complete the following information): no need
Proposed fix should this line be:
for key in self.args.json_keys:
builders[key].finalize(output_idx_files[key])
?
Additional context nothing
Marking as stale. No activity in 60 days.
@forrestjgq I have same issue.Did you find the solution?
Marking as stale. No activity in 60 days.