JustinLin610 commited on
Commit
90e0293
1 Parent(s): 335e715

Update README.md

Browse files

reformat code of generator

Files changed (1) hide show
  1. README.md +7 -2
README.md CHANGED
@@ -43,8 +43,13 @@ After, refer the path to OFA-tiny to `ckpt_dir`, and prepare an image for the te
43
 
44
  >>> # using the generator of fairseq version
45
  >>> model = OFAModel.from_pretrained(ckpt_dir, use_cache=True)
46
- >>> generator = sequence_generator.SequenceGenerator(tokenizer=tokenizer,beam_size=5, max_len_b=16,
47
- min_len=0, no_repeat_ngram_size=3) # using the generator of fairseq version
 
 
 
 
 
48
  >>> data = {}
49
  >>> data["net_input"] = {"input_ids": inputs, 'patch_images': patch_img, 'patch_masks':torch.tensor([True])}
50
  >>> gen_output = generator.generate([model], data)
 
43
 
44
  >>> # using the generator of fairseq version
45
  >>> model = OFAModel.from_pretrained(ckpt_dir, use_cache=True)
46
+ >>> generator = sequence_generator.SequenceGenerator(
47
+ tokenizer=tokenizer,
48
+ beam_size=5,
49
+ max_len_b=16,
50
+ min_len=0,
51
+ no_repeat_ngram_size=3,
52
+ )
53
  >>> data = {}
54
  >>> data["net_input"] = {"input_ids": inputs, 'patch_images': patch_img, 'patch_masks':torch.tensor([True])}
55
  >>> gen_output = generator.generate([model], data)