lupantech / MathVista

MathVista: data, code, and evaluation for Mathematical Reasoning in Visual Contexts
https://mathvista.github.io/
Creative Commons Attribution Share Alike 4.0 International
197 stars 28 forks source link

How to use generate_responses.py? (References non-existing utilities module) #13

Closed mattmazzola closed 4 months ago

mattmazzola commented 4 months ago

I am trying to run the MathVista evaluation pipeline using the instructions and 3 step process here: https://github.com/lupantech/MathVista?tab=readme-ov-file#evaluation-pipelines

However, when I attempt to run generate_response.py it fails with:

    from utilities import *
ModuleNotFoundError: No module named 'utilities'

https://github.com/lupantech/MathVista/blob/1c9b5dac19053274f4bdc6e5608069551e575ece/evaluation/generate_response.py#L10-L10

How do I use generate responses?

mattmazzola commented 4 months ago

Ah, I notice it is because the sys.path.append('../') relies on the script being run from a certain location.

This should be called out in the README as I assume it would be similar issue for others that wouldn't expect this.

Also, there are some other minor issues or things to clarify:

https://github.com/lupantech/MathVista/blob/1c9b5dac19053274f4bdc6e5608069551e575ece/evaluation/generate_response.py#L12

and without having them installed it can fail. Example for claude/anthropic

    from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
ModuleNotFoundError: No module named 'anthropic'
pip install opencv-python
pip install word2number

Given the original issues was about how to use the file and utilities I will resolve. I think can manually update the openai code to use the 1+ version