roboflow / awesome-openai-vision-api-experiments

Must-have resource for anyone who wants to experiment with and build on the OpenAI vision API 🔥
1.65k stars 130 forks source link

TypeError: __init__() missing 1 required positional argument: 'api_key' #3

Closed leayz-888 closed 1 year ago

leayz-888 commented 1 year ago

Hi, thank you for your great work! When I ran the gpt4v-grounding-dino-detection task, I encountered an error: Traceback (most recent call last): File "/home/project/awesome-openai-vision-api-experiments/experiments/gpt4v-grounding-dino-detection/app.py", line 15, in classification_model=GPT4V( TypeError: init() missing 1 required positional argument: 'api_key' How to solve it? Looking forward to your answer, thank you!

pzmudzinski commented 1 year ago

Had the same issue and fixed it by passing api_key directly. No idea why it isn't picked up automatically.

GPT4V(
    api_key=os.environ["OPENAI_API_KEY"],
    ...
)
SkalskiP commented 1 year ago

@pzmudzinski would you be willing to create PR with that fix?

pzmudzinski commented 1 year ago

sure 👍

SkalskiP commented 1 year ago

Awesome! Appreciate it!

SkalskiP commented 1 year ago

Hi, @leayz-888! 👋🏻 The problem should be solved. I'm closing the issue, but feel free to reopen it if you will face more issues.