mshukor commited on
Commit
961d6ba
·
1 Parent(s): 9223ee5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -186,12 +186,12 @@ def bin2coord(bins, w_resize_ratio, h_resize_ratio, cfg):
186
 
187
  def encode_text(text, length=None, append_bos=False, append_eos=False):
188
  line = [
189
- caption_task.bpe.encode(' {}'.format(word.strip()))
190
  if not word.startswith('<code_') and not word.startswith('<bin_') else word
191
  for word in text.strip().split()
192
  ]
193
  line = ' '.join(line)
194
- s = caption_task.tgt_dict.encode_line(
195
  line=line,
196
  add_if_not_exist=False,
197
  append_eos=False
 
186
 
187
  def encode_text(text, length=None, append_bos=False, append_eos=False):
188
  line = [
189
+ general_task.bpe.encode(' {}'.format(word.strip()))
190
  if not word.startswith('<code_') and not word.startswith('<bin_') else word
191
  for word in text.strip().split()
192
  ]
193
  line = ' '.join(line)
194
+ s = general_task.tgt_dict.encode_line(
195
  line=line,
196
  add_if_not_exist=False,
197
  append_eos=False