PrimerAI / blanc

Human-free quality estimation of document summaries
MIT License
94 stars 11 forks source link

IndexError: string index out of range #10

Closed pwo42 closed 3 years ago

pwo42 commented 3 years ago

Hi

When I run the "Basic usage" example in README, I received the error, "IndexError: string index out of range".

~\anaconda3\lib\site-packages\blanc\blanc.py in run_inference_batch(self, model, batch) 318 predictions = {} 319 for idx in model_input.masked_idxs: --> 320 predicted_id = model_output[idx].argmax() 321 (predicted_token,) = self.model_tokenizer.convert_ids_to_tokens([predicted_id]) 322 predictions[idx] = predicted_token

IndexError: string index out of range

OlegVasilyev4096 commented 3 years ago

Thanks! What versions of torch and transformers?

pwo42 commented 3 years ago

Hi, they are:

torch==1.7.1 transformers==4.3.2

Thank you!

OlegVasilyev4096 commented 3 years ago

For now please use transformers<=3.5.1

OlegVasilyev4096 commented 3 years ago

Fixed. The reason was different default of BERT output format in transformers version >=4.0.0