<commit_before>package mmbn;
import rand.ByteStream;
import rand.DataProducer;

public class FolderProducer implements DataProducer<Folder> {
    protected final RewardProducer rewardProducer;
    
    public FolderProducer(RewardProducer rewardProducer) {
        this.rewardProducer = rewardProducer;
    }
    
    @Override
    public Folder readFromStream(ByteStream stream) {
        Folder folder = new Folder();
        
        while (folder.isFull()) {
            folder.addChip(this.rewardProducer.readFromStream(stream));
        }
        
        return folder;
    }

    @Override
    public void writeToStream(ByteStream stream, Folder folder) {
        for (Reward chip : folder.getChips()) {
            this.rewardProducer.writeToStream(stream, chip);
        }
    }
    
    public ChipLibrary library() {
        return this.rewardProducer.library();
    }
}<commit_msg>Fix bug with folders not loading.<commit_after>package mmbn;
import rand.ByteStream;
import rand.DataProducer;

public class FolderProducer implements DataProducer<Folder> {
    protected final RewardProducer rewardProducer;
    
    public FolderProducer(RewardProducer rewardProducer) {
        this.rewardProducer = rewardProducer;
    }
    
    @Override
    public Folder readFromStream(ByteStream stream) {
        Folder folder = new Folder();
        
        while (!folder.isFull()) {
            folder.addChip(this.rewardProducer.readFromStream(stream));
        }
        
        return folder;
    }

    @Override
    public void writeToStream(ByteStream stream, Folder folder) {
        for (Reward chip : folder.getChips()) {
            this.rewardProducer.writeToStream(stream, chip);
        }
    }
    
    public ChipLibrary library() {
        return this.rewardProducer.library();
    }
}
{'fraction_non_alphanumeric': 0.08291873963515754, 'fraction_numerical': 0.0, 'mean_word_length': 2.6127744510978044, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5654351', 'n_tokens_mistral': 517, 'n_tokens_neox': 506, 'n_words': 109}