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

FEAT Add image generation example with red teaming orchestrator and unify existing orchestrator definitions #189

Merged
merged 23 commits into from
May 19, 2024

Conversation

romanlutz
Copy link
Contributor

Description

This is based on #82 by @ysy970923 and related to #74.

The goal of this PR was to create a notebook example for image generation where we use a model to generate prompts that we pass to the image generation endpoint. We then score the response and pass the scoring result back to the prompt generating model. If the score indicates that we succeeded we can stop. If a prompt gets blocked (due to content filters) we can pass that information back to the model as well so that it can generate a better prompt.

While making the adjustments from the original PR to support this natively within the red teaming orchestrator it became evident that the additional complexity we introduced to support EndTokenRedTeamingOrchestrator would make maintaining this going forward even tougher. Since that orchestrator can be supported using a scoring red teaming orchestrator (with small modifications), a large part of the changes in this PR are about unifying the definitions into a single RedTeamingOrchestrator that uses a scorer and now also supports images.
[FYI @rlundeen2 as mentioned a week ago]

In this process, I discovered that some validation code (e.g., in the DALLE Target) may not be working as intended. The target should know what to send. So if it can only accept 1 prompt request piece then we should send just that rather than failing validation. The normalizer is currently unaware of what the target may or may not accept and can't adjust. FYI @rdheekonda

Apart from that, the DALLE Target needs to handle errors slightly differently. When no image was generated, the data type has to be text since we don't have an image_path for an image to store. Otherwise, the memory code raises exceptions. FYI @jbolor21

Tests and Documentation

Note that tests and other notebooks have yet to be adjusted.

@romanlutz romanlutz added documentation Improvements or additions to documentation enhancement New feature or request labels May 4, 2024
@romanlutz romanlutz merged commit c23fbcd into Azure:main May 19, 2024
5 checks passed
@romanlutz romanlutz deleted the add-dalle-example branch May 19, 2024 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants