Skip to content

Commit

Permalink
add a comment change in model.py to enable voc-contrained decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
amsword committed Sep 28, 2023
1 parent 187fc22 commit faae4fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions generativeimage2text/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ def get_git_model(tokenizer, param):
length_penalty=0.6,
)

#from .trie_decoder import TrieAutoRegressiveBeamSearch, get_trie
#decoder = TrieAutoRegressiveBeamSearch(
#eos_index=tokenizer.sep_token_id,
#max_steps=1022,
#beam_size=1,
#trie=get_trie(tokenizer),
#)

model = CaptioningModel(
image_encoder,
text_decoder,
Expand Down

0 comments on commit faae4fb

Please sign in to comment.