From fc262150f06fafabddd8f6893f20122d324fee9e Mon Sep 17 00:00:00 2001 From: chaoyi-wu <18706207256@163.com> Date: Mon, 11 Sep 2023 11:53:56 +0800 Subject: [PATCH] Update test.py --- Quick_demo/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Quick_demo/test.py b/Quick_demo/test.py index 2117646..312a840 100644 --- a/Quick_demo/test.py +++ b/Quick_demo/test.py @@ -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(): @@ -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') @@ -119,4 +119,4 @@ def main(): if __name__ == "__main__": main() - \ No newline at end of file +