-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
add initial support for Amazon Nova Canvas model #7838
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: omrishiv <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@omrishiv can you share a screenshot of it passing your testing |
@krrishdholakia is there not one attached to the text? If you look at the bottom you’ll see the test name and it passing. |
""" | ||
No additional OpenAI params are mapped for Nova | ||
""" | ||
return [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does amazon nova not support any openai image gen params?
if you could link me to their optional params that would help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imageGenerationConfig":{"cfgScale":8,"seed":42,"quality":"standard","width":1280,"height":720,"numberOfImages":3}
i see:
- n -> numberOfImages
- quality -> quality [if quality="hd" => quality="premium"]
- size -> split into width x height
https://docs.aws.amazon.com/nova/latest/userguide/image-gen-req-resp-structure.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m happy to convert those to the Nova ones, I’ll update for that
""" | ||
Map the OpenAI params to the Bedrock params | ||
|
||
No OpenAI params are mapped for Nova, so directly return the optional_params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
width, height = _size.split("x") | ||
width, height = int(width), int(height) | ||
number_of_images = non_default_params.get("n", 1) | ||
quality = "premium" if non_default_params.get("quality") == "premium" else "standard" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it also handle the openai equivalent value - hd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize, I now understand what this is doing. Can you clarify if intend for this to only handle openAI API parameters or if it should work for both? As in, would I expect quality premium|hd
is premium
or if we are only handling the openAI ones
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
I've added the rest of the image generation tasks:
I'll push the changes soon |
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
@krrishdholakia when you have a moment, can you please take a look at this again. I added all of the image generation tasks and tests for all of them. Thank you! |
Title
Add initial support for Amazon Nova Canvas image generation
Relevant issues
Type
🆕 New Feature
Changes
[REQUIRED] Testing - Attach a screenshot of any new tests passing locally
Added new test
TestBedrockNova