Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed "TypeError: 'NoneType' object is not iterable" for reward model… (
LAION-AI#3587) During training the reward model using the `oasst` dataset, using the following command: ```bash python trainer_rm.py --configs defaults_rm oasst-rm-1-pythia-1.4b ``` the data loader raises an error: **TypeError: 'NoneType' object is not iterable** ``` │ Open-Assistant/model/model_training/custom_datasets/oasst_dataset.py:102 in leaf_filter│ │ │ │ 99 │ │ │ │ # their (ranked) replies as possible continuations. │ │ 100 │ │ │ │ return ( │ │ 101 │ │ │ │ │ thread[-1].role == "prompter" │ │ > 102 │ │ │ │ │ and len([r for r inthread[-1].replies if r.rank is not None]) > 1 │ │ 103 │ │ │ │ │ and thread_filter(thread) │ │ 104 │ │ │ │ ) │ │ 105 │ │ │ elif mode == "rl": │ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ``` I inserted a condition in line 100 as below to fix this issue and submit this PR ```python if thread[-1].replies is None: return False ```
- Loading branch information