cvlab-columbia / viper

Code for the paper "ViperGPT: Visual Inference via Python Execution for Reasoning"
Other
1.63k stars 117 forks source link

Modifications to work with gpt-3.5-turbo #6

Closed devaansh100 closed 1 year ago

devaansh100 commented 1 year ago

With codex gone, I was trying to run viper with gpt-3.5-turbo but was facing some errors. I have fixed them here.

Changes:

  1. main_simple_lib.py: ChatGPT gives def execute_command(image) as its output, I assume because of its system behavior. I've removed prepending the function header in get_code.
  2. vision_models.py: Somehow I was not getting an output with best_of parameter in the API, hence I removed it. Anyway, as per the documentation, it defaults to 1. Also returning the entire output rather than just the first(and only output). Finally, added the line to send back the same parameters in the function definition as expected while using codex.

Hope we can discuss them!

sachit-menon commented 1 year ago

Thanks for the PR and sorry for the delay! You're right, the chat models do seem to add the function header in. I merged your PR with a slight modification to do the same for GPT-4. Appreciate it!

devaansh100 commented 1 year ago

Thank you!