Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Handling and Image Description fixed seed problem #73

Closed
vraagje opened this issue Jul 14, 2024 · 11 comments
Closed

Error Handling and Image Description fixed seed problem #73

vraagje opened this issue Jul 14, 2024 · 11 comments

Comments

@vraagje
Copy link

vraagje commented Jul 14, 2024

Issue 1: Limit Retries on Error or Add Cancel Option
Currently, when an error occurs, Grip attempts to retry the operation 10 times. During this process, the interface becomes unresponsive until all retry attempts are completed.
Suggestion:
Consider implementing one or both of these improvements:

Reduce the number of automatic retries from 10 to a lower number.
Add a feature to cancel the job during the retry process.

Issue 2: Inconsistent Behavior with Image Description Agent seed
I've noticed an inconsistency with the image description agent:
When the seed is set to a fixed value in the Anthropic configuration node, the image description agent still runs each time instead of just once as expected.

Expected: With a fixed seed, the image description agent should only run once and cache the output when the input image is not changed.

Copy link
Collaborator

shhlife commented Jul 14, 2024

Thank you very much for the report - I’ll see what I can do to resolve the issues.

Cheers!

@shhlife
Copy link
Collaborator

shhlife commented Jul 15, 2024

For issue 1, there's a parameter in Griptape to modify the max_subtasks. This will tell the agent to reduce the number of tasks it uses to accomplish a goal when using tools - but it doesn't currently differentiate between successful tasks and errored tasks. I'm adding a ticket to the backlog to add that feature.

I'll also add a max_subtasks parameter to the Create Agent node and to the Run ToolkitTask node - so you can shorten that if you like in the meantime. :)

Canceling a job is something that is on the list as well - as soon as it's in the framework, I'll add it!

Will take a look at issue 2 now.

@shhlife
Copy link
Collaborator

shhlife commented Jul 15, 2024

btw - here's the link to the ticket asking for max_retries: griptape-ai/griptape#981

@collindutter
Copy link
Member

@shhlife this actually sounds like it's the Prompt Driver that is retrying -- not the Agent using Tools.

This can be changed today by setting max_attempts on the Prompt Driver -- it defaults to 10.

@shhlife
Copy link
Collaborator

shhlife commented Jul 15, 2024

thanks @collindutter! I'll add that field!

@vraagje
Copy link
Author

vraagje commented Jul 15, 2024

Thank you Jason and Colin. The max-subtasks feature would be very helpful.
I've encountered another issue related to fixed seeds. When using a fixed seed, Griptape sends a request to Anthropic as usual. The first time, Claude responds correctly. However, when changing the image while keeping the seed fixed, Claude returns an error:

Error code: 400 - {
  'type': 'error',
   'error': {
    'type': 'invalid_request_error',
     'message': 'messages: roles must alternate between "user" and "assistant", but found multiple "user" roles in a row'
  }
}

The issue likely stems from reusing the same "PromptTask" with a fixed seed. This could also potentially occur with random seeds, as they're limited to 0-2048. When processing hundreds of images in batch, there's a chance of generating identical "random" numbers consecutively, leading to errors.
To address this, it would be beneficial to have a much larger seed range, similar to what ComfyUI uses, well beyond the current 0-2048 limit.

maybe my workflow is not correct, I used this simple setup: https://we.tl/t-2XZlo1ADXq
Thanks,
Frank

@shhlife
Copy link
Collaborator

shhlife commented Jul 15, 2024

Thanks @vraagje - I'll check that out. In the meantime, I've pushed a fix for issue#2 to dev, just adding a few more items and running a few tests before pushing to main.

@shhlife
Copy link
Collaborator

shhlife commented Jul 15, 2024

Hmm - trying to replicate your issue and it doesn't appear to be happening to me. It could be that my fix for the other issue of the config getting re-evaluated resolved it?

I'll push the fix to main shortly & then if you could try it, that'd be great.

@vraagje
Copy link
Author

vraagje commented Jul 15, 2024

accidental fix :) . I try when pushed let me know

@vraagje
Copy link
Author

vraagje commented Jul 16, 2024

Hey Jason, Just saw the fix you put out - my bad for not noticing earlier! Gave it a try and looks like both problems are sorted now. Great!

@shhlife
Copy link
Collaborator

shhlife commented Jul 16, 2024

Awesome, thanks! :)

@shhlife shhlife closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants