PhyscalX commited on
Commit
437fe89
1 Parent(s): 4cee877

Remove unsqueeze for semantic tokens

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -92,7 +92,7 @@ class Predictor(object):
92
  concepts, scores = self.model.predict_concept(outputs["sem_embeds"][mask_index])
93
  concepts, scores = [x.reshape(batch_shape) for x in (concepts, scores)]
94
  # Generate captions.
95
- sem_tokens = outputs["sem_tokens"][mask_index].unsqueeze_(1)
96
  captions = self.model.generate_text(sem_tokens).reshape(batch_shape)
97
  # Postprocess results.
98
  results = []
 
92
  concepts, scores = self.model.predict_concept(outputs["sem_embeds"][mask_index])
93
  concepts, scores = [x.reshape(batch_shape) for x in (concepts, scores)]
94
  # Generate captions.
95
+ sem_tokens = outputs["sem_tokens"][mask_index]
96
  captions = self.model.generate_text(sem_tokens).reshape(batch_shape)
97
  # Postprocess results.
98
  results = []