You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/examples/example_gpt4vison.py

15 lines
390 B

from swarms import GPT4VisionAPI
# Initialize with default API key and custom max_tokens
api = GPT4VisionAPI(max_tokens=1000)
# Define the task and image URL
task = "Describe the scene in the image."
img = "/home/kye/.swarms/swarms/examples/Screenshot from 2024-02-20 05-55-34.png"
# Run the GPT-4 Vision model
response = api.run(task, img)
# Print the model's response
print(response)