passing in an `attention_mask` since your input_ids may be padded

#154
by pchiang5 - opened

When I used InSilicoPerturber with a fine-tuned model with the input below, it showed a warning "We strongly recommend passing in an attention_mask since your input_ids may be padded. See https://huggingface.co/docs/transformers/troubleshooting#incorrect-output-when-padding-tokens-arent-masked." Is it safe to ignore it, or where shall I find the attention_mask to avoid this message? Thank you.

isp = InSilicoPerturber(perturb_type="overexpress",
                        perturb_rank_shift=None,
                        genes_to_perturb="all",
                        combos=0,
                        anchor_gene=None,
                        model_type="CellClassifier",
                        num_classes=29,
                        emb_mode="cell",
                        cell_emb_style="mean_pool",
                        cell_states_to_model={"cell_type":(["A"],["B"], [])},
                        max_ncells=2000,
                        emb_layer=0,
                        forward_batch_size=16,
                        nproc=16) 

Thank you for your question! We added attention masks in locations where we are padding - please pull the updated version.

ctheodoris changed discussion status to closed

Will open a new discussion.

pchiang5 changed discussion status to open

Thank you for your question. Since this is unrelated to the attention mask, please open a new discussion with a title that is descriptive of this discussion so that others can easily find the information should they have the same question later. Also, please provide the full set of arguments you are using to run the in silico perturber so we can reproduce the error and help troubleshoot.

ctheodoris changed discussion status to closed

Sign up or log in to comment