Hello, I have a question about what tranformer agents can and canât do. I was running the Notebook titled âTransformers can do Anythingâ and I modified the prompt about captioning the boat in the following way.
caption = agent.run(âCan you caption the
boat_image
? Use at least 35 words in the captionâ, boat_image=boat)
The part that I added is the second sentence âUse at least 35 words in the caption.â The agent then generates the following.
==Code generated by the agent==
caption = image_captioner(boat_image)
while len(caption.split()) < 35:
caption = image_captioner(boat_image)
print(f"The caption is {caption}")
==Result==
Evaluation of the code stopped at line 1 before the end because of the following error:
While is not supported.
/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py:1346: UserWarning: Using `max_length`'s default (20) to control the generation length. This behaviour is deprecated and will be removed from the config in v5 of Transformers -- we recommend using `max_new_tokens` to control the maximum length of the generation. warnings.warn(
'Pokemon boats and pio'
Is this because the code is being run in a notebook? Or is it a general restriction on what code the agents can execute? Or is it just me missing something silly?
Thanks for any advice