### Serve CaptchaMind-7B with vLLM Source: https://github.com/alibabaresearch/captcha-mind/blob/main/README.md Installs vLLM and starts a local server for the CaptchaMind-7B model, exposing an OpenAI-compatible chat completions endpoint at http://localhost:8000/v1/chat/completions. ```bash pip install vllm vllm serve AIDC-AI/CaptchaMind-7B \ --served-model-name CaptchaMind-7B \ --port 8000 \ --limit-mm-per-prompt image=8 ``` -------------------------------- ### Install CaptchaMind harness Source: https://github.com/alibabaresearch/captcha-mind/blob/main/README.md Clones the repository and installs the package in editable mode. Requires Python 3.9+ and transitively installs requests and Pillow. ```bash git clone https://github.com/AlibabaResearch/captcha-mind cd captcha-mind pip install -e . ``` -------------------------------- ### Sample data record for dice_count task Source: https://github.com/alibabaresearch/captcha-mind/blob/main/README.md Example JSON line from a data.jsonl file showing the image filename, ground truth answer, and interactive region coordinates. ```json {"image": "image.png", "ground_truth": 77, "input_box": [30, 690, 610, 755], "submit_box": [700, 665, 925, 750]} ``` -------------------------------- ### Select task in main() by uncommenting test function Source: https://github.com/alibabaresearch/captcha-mind/blob/main/README.md Uncomment the desired test function in main() to run a specific CAPTCHA task. The example shows test_coordinates_batch() active. ```python def main(): # test_connect_icon_batch() # test_dart_count_batch() # test_click_order_batch() test_coordinates_batch() # test_dice_count_batch() # test_rotation_match() # test_slide_puzzle_batch() # test_image_recognition_batch() # test_patch_select_batch() ``` -------------------------------- ### Download CaptchaBench dataset from Hugging Face Source: https://github.com/alibabaresearch/captcha-mind/blob/main/README.md Downloads the AIDC-AI/Captcha dataset to ./captcha_data. Requires the huggingface_hub package. ```bash pip install -U huggingface_hub huggingface-cli download AIDC-AI/Captcha --repo-type dataset --local-dir ./captcha_data ``` -------------------------------- ### Configure harness endpoint in model_utils.py Source: https://github.com/alibabaresearch/captcha-mind/blob/main/README.md Edit captcha/utils/model_utils.py to set the vLLM endpoint URL, token, and model mapping. The token can be any non-empty string for local vLLM. ```python AIDC_URL = "http://localhost:8000/v1/chat/completions" # your vLLM endpoint AIDC_TOKEN = "EMPTY" # any non-empty string for local vLLM AIDC_MODEL_MAPPING = { ... "qwen-7b-sft": "CaptchaMind-7B", # map the harness alias to your served-model-name } ``` -------------------------------- ### Configure model alias and sample count in run.py Source: https://github.com/alibabaresearch/captcha-mind/blob/main/README.md Set MODEL_NAME to a key in AIDC_MODEL_MAPPING and MAX_SAMPLES to limit evaluation; set to None to evaluate all test samples. ```python MODEL_NAME = "qwen-7b-sft" # must match a key in AIDC_MODEL_MAPPING MAX_SAMPLES = 50 # set to None to evaluate all test samples ``` -------------------------------- ### Run evaluation script Source: https://github.com/alibabaresearch/captcha-mind/blob/main/README.md Execute the batch evaluation from the captcha directory. Each run prints a running success rate and writes a detailed JSON report to captcha/test_results/_.json. ```bash cd captcha python run.py ```