JustinLin610 commited on
Commit
01ecca4
1 Parent(s): a929d82

Update README.md

Browse files

reformat code of generator

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