gurgenblbulyan commited on
Commit
255436a
1 Parent(s): bfe8408

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +1 -1
inference.py CHANGED
@@ -23,7 +23,7 @@ class Inference:
23
  self.tokenizer.add_special_tokens({'pad_token': '[PAD]'})
24
  self.encoder_decoder_model.decoder.resize_token_embeddings(len(self.tokenizer))
25
 
26
- generated_ids = self.encoder_decoder_model.generate(pixel_values.unsqueeze(0).to(self.device), max_length=self.max_length, early_stopping=True)
27
  generated_text = self.tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
28
 
29
  return generated_text
 
23
  self.tokenizer.add_special_tokens({'pad_token': '[PAD]'})
24
  self.encoder_decoder_model.decoder.resize_token_embeddings(len(self.tokenizer))
25
 
26
+ generated_ids = self.encoder_decoder_model.generate(pixel_values.unsqueeze(0).to(self.device),early_stopping=True)#, max_length=self.max_length, )
27
  generated_text = self.tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
28
 
29
  return generated_text