This is code for generate instruction data via GPT-API following LLaVA style.
Run following command to run GPT API and for coco samples. In-context examples are from LLaVA dataset.
python llava-instruction.py
Normally, only api key needed.
import openai
openai.api_key = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Change version of ChatGPT you want to use.
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo", # or "gpt-4"
messages=message_copy
)
Sometimes, organization ID may also be required.
openai.organization = "org-xxxxxxx"