Siqi Liang
Siqi Liang
In [__get_ppl()](https://github.com/Shark-NLP/OpenICL/blob/1613ae10b88ba2dbfed425c4ee078b2a6586152e/openicl/icl_inferencer/icl_ppl_inferencer.py#L164) of `PPLInferencer`, at [line 186](https://github.com/Shark-NLP/OpenICL/blob/1613ae10b88ba2dbfed425c4ee078b2a6586152e/openicl/icl_inferencer/icl_ppl_inferencer.py#L186) ```python lens = (inputs["input_ids"] != self.tokenizer.pad_token_id).sum(-1).cpu().numpy() ``` where it tries to calculate the token number of each text sample in `input_texts`, by count...
add non_blocking arg in `ListWrapper.to` to support `transformers>=4.48.0`. For `transformers "BatchEncoding": """ Send all values to device by calling `v.to(device)` (PyTorch only). Args: device (`str` or `torch.device`): The device to...