File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838
3939import argparse
4040import json
41- import os
4241import subprocess
4342import sys
4443import tempfile
@@ -387,7 +386,9 @@ def infer(
387386 text_content = msg ["content" ]
388387 # Replace <image> tag in text with proper multi-modal format
389388 if "<image>" in text_content :
390- text_content = text_content .replace ("<image>\n " , "" ).replace ("<image>" , "" )
389+ text_content = text_content .replace ("<image>\n " , "" ).replace (
390+ "<image>" , ""
391+ )
391392 msg ["content" ] = [
392393 {"type" : "image" },
393394 {"type" : "text" , "text" : text_content },
@@ -404,9 +405,7 @@ def infer(
404405 text = [text ], images = [image ], return_tensors = "pt" , padding = True
405406 )
406407 else :
407- inputs = infer ._processor (
408- text = [text ], return_tensors = "pt" , padding = True
409- )
408+ inputs = infer ._processor (text = [text ], return_tensors = "pt" , padding = True )
410409
411410 inputs = inputs .to (infer ._model .device )
412411
You can’t perform that action at this time.
0 commit comments