swarms/playground/models/gpt4_v.py

16 lines
324 B

from swarms.models.gpt4v import GPT4Vision
api_key = ""
gpt4vision = GPT4Vision(
openai_api_key=api_key,
)
img = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/VFPt_Solenoid_correct2.svg/640px-VFPt_Solenoid_correct2.svg.png"
task = "What is this image"
answer = gpt4vision.run(task, img)
print(answer)