ValueError: decoder_start_token_id....

#7
by Ruzwaahn - opened

Hi I've downloaded all files and have run the following code:

processor = TrOCRProcessir.from_pretrained('./', local_files_only=True)

Model= VisionEncoderDecoderModel.from_pretrained('./', local_files_only=True)

image = image.open("...")
pixel_values = processor(images=image, return_tensors="pt").pixel_values

generated_ids = model.generate(pixel_values)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]

And I'm getting the following error:
ValueError: 'decoder_start_token_id' or 'bos_token_id' has to be defined for encoder-decoder generation.

Sign up or log in to comment