Skip to content

Commit

Permalink
duplicate samples each time they are used
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Oct 24, 2023
1 parent 1fad562 commit fafbd7e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions stanza/models/pos/data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from os import set_inheritable
import random
import logging
import copy
import torch
from collections import namedtuple

Expand Down Expand Up @@ -184,8 +185,11 @@ def __getitem__(self, key):
pretrained = sample.pretrain

# and deal with char
char = [i.copy() for i in sample.char]

char = copy.deepcopy(sample.char)
words = copy.deepcopy(words)
xpos = copy.deepcopy(xpos)
ufeats = copy.deepcopy(ufeats)
pretrained = copy.deepcopy(pretrained)
raw_text = sample[6]

# mask out the elements that we need to mask out
Expand Down

0 comments on commit fafbd7e

Please sign in to comment.