Skip to content

Commit

Permalink
Update test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoyi-wu authored Sep 11, 2023
1 parent 68be36c commit fc26215
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Quick_demo/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def combine_and_preprocess(question,image_list,image_padding_tokens):

vision_x = torch.cat(images,dim = 1).unsqueeze(0) #cat tensors and expand the batch_size dim
text = ''.join(new_qestions)
return [text], vision_x,
return text, vision_x,


def main():
Expand Down Expand Up @@ -106,7 +106,7 @@ def main():
model.eval()
with torch.no_grad():
lang_x = text_tokenizer(
question, max_length=2048, truncation=True, return_tensors="pt"
text, max_length=2048, truncation=True, return_tensors="pt"
)['input_ids'].to('cuda')

vision_x = vision_x.to('cuda')
Expand All @@ -119,4 +119,4 @@ def main():

if __name__ == "__main__":
main()


0 comments on commit fc26215

Please sign in to comment.