-
Notifications
You must be signed in to change notification settings - Fork 189
Open
Description
As I tried to use c4 dataset to run gptq, got an ValueError("empty range for randrange() (%d, %d, %d)" % (istart, istop, width)) , during debugging i found there may be some logical trouble about the code below when the number of tmp.input_ids.shape[1] is equal to the value of seqlen. We got a random.randint(0, -1).
import random
random.seed(0)
valenc = []
for _ in range(256):
while True:
i = random.randint(0, len(valdata) - 1)
tmp = tokenizer(valdata[i]['text'], return_tensors='pt')
if tmp.input_ids.shape[1] >= seqlen:
break
i = random.randint(0, tmp.input_ids.shape[1] - seqlen - 1)
j = i + seqlen
valenc.append(tmp.input_ids[:, i:j])
Metadata
Metadata
Assignees
Labels
No labels
