Skip to content

Commit

Permalink
FIX Doc error prompt tuning seq len calc (#1686)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Podivin <jpodivin@gmail.com>
  • Loading branch information
jpodivin authored Apr 29, 2024
1 parent 250b7eb commit e19f7bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/task_guides/prompt_based_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def preprocess_function(examples, text_column="Tweet text", label_column="text_l
model_inputs["attention_mask"][i] = [0] * (max_length - len(sample_input_ids)) + model_inputs[
"attention_mask"
][i]
labels["input_ids"][i] = [-100] * (max_length - len(sample_input_ids)) + label_input_ids
labels["input_ids"][i] = [-100] * (max_length - len(label_input_ids)) + label_input_ids
model_inputs["input_ids"][i] = torch.tensor(model_inputs["input_ids"][i][:max_length])
model_inputs["attention_mask"][i] = torch.tensor(model_inputs["attention_mask"][i][:max_length])
labels["input_ids"][i] = torch.tensor(labels["input_ids"][i][:max_length])
Expand Down

0 comments on commit e19f7bf

Please sign in to comment.