penghao-wu / vstar

PyTorch Implementation of "V* : Guided Visual Search as a Core Mechanism in Multimodal LLMs"
https://vstar-seal.github.io/
MIT License
497 stars 32 forks source link

Some questions about the valid check while inference #16

Closed xuanfengzu closed 2 months ago

xuanfengzu commented 2 months ago

I noticed that there are several lines of code in the inference function:

## input valid check
if not re.match(r"^[A-Za-z ,.!?\'\"]+$", input_str) or len(input_str) < 1:
    output_str = "[Error] Invalid input: ", input_str
    return output_str, None

I want to ask if the purpose of this check is because the search model vocabulary does not contain characters other than these? I really want to figure this out because some of my inputs contain common characters like ":"";", but these are banned, which makes me very frustrated.

penghao-wu commented 2 months ago

This check here might be too conservative. You can remove or modify this if your inputs contain other common characters.