Skip to content

Commit d70e3d3

Browse files
author
Googler
committed
Py typing fix
PiperOrigin-RevId: 615594853
1 parent 45887d3 commit d70e3d3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lit_nlp/components/cf_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def update_prediction(
4040
label_names = pred_spec.vocab
4141
pred_class = np.argmax(prediction)
4242
example_label = label_names[pred_class]
43-
example[label_key] = example_label
43+
if label_key is not None:
44+
example[label_key] = example_label
4445

4546

4647
def is_prediction_flip(

0 commit comments

Comments
 (0)