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: Brochure Creation Notebook #460
Conversation
Added Changes for Brochure Maker
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
language/use-cases/prod-catalog-enrichment/genai_prod_catalog_enrichment.ipynb
Outdated
Show resolved
Hide resolved
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:16Z Can you link the other author's github page? slatawa commented on 2024-05-10T04:47:57Z Added |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:16Z Remove the extra title in this cell.
Change the objectives to be all the same tense. e.g.
slatawa commented on 2024-05-10T04:50:58Z Incorporated |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:17Z Change these pip installs to one line, include upgrade, quiet and install vertex ai sdk
slatawa commented on 2024-05-10T04:52:09Z Changed |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:18Z Remove slatawa commented on 2024-05-10T04:55:00Z Updated |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:19Z Add vertex ai imports and initialize vertex sdk at the beginning slatawa commented on 2024-05-10T08:33:17Z Done |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:19Z Replace project id with a placeholder slatawa commented on 2024-05-10T05:59:39Z Updated |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:20Z I'm not sure this is needed. slatawa commented on 2024-05-10T05:59:57Z have removed these now |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:21Z Describe what these prompts are for. slatawa commented on 2024-05-10T06:02:31Z Added description |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:22Z Clarify more what the code is doing. It's using Gemini to generate an Imagen prompt. slatawa commented on 2024-05-10T07:11:58Z Added details on this |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:22Z Line #3. import vertexai.preview.generative_models as generative_models You shouldn't need this extra import. Just import the specific classes/modules from generative_models slatawa commented on 2024-05-10T07:12:53Z this has been removed now |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:23Z Line #5. def generate_imagen_prompt_using_llm(temperature, colors , is_blurred, patterns,style ): Add type hints to this function.
Also change slatawa commented on 2024-05-10T07:18:32Z Updated |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:24Z Line #6. vertexai.init(project=PROJECT_ID, location=REGION) Put this once at the beginning of the notebook. slatawa commented on 2024-05-10T07:19:06Z updated |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:25Z Line #9. add_blur_text = "" This can be simplified to:
add_blur_text = "Blur the generated Image" if is_blurred else "" slatawa commented on 2024-05-10T07:20:01Z Updated |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:25Z Line #32. generation_config={ Use the slatawa commented on 2024-05-10T09:03:27Z Resolved |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:26Z Line #51. return prompt_str This can be simplified. I'd recommend not using stream for this use case. Then you can just return
slatawa commented on 2024-05-10T08:58:24Z Done |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:27Z Line #1. from vertexai.preview.vision_models import ImageGenerationModel Move these imports to the top of the notebook. slatawa commented on 2024-05-10T07:24:20Z Removed |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:28Z Line #8. seed = None, Add types for all parameters slatawa commented on 2024-05-10T07:27:11Z Updated |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:28Z Line #11. ): Add return type. slatawa commented on 2024-05-10T07:28:32Z Added |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:29Z Line #22. image_bytes = io.BytesIO(image._image_bytes) # Convert to in-memory file I don't think you need to do all of this?
You can directly access the PIL Image through
And display the image through
slatawa commented on 2024-05-10T09:07:43Z Resolved |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:30Z Line #2. def make_brochure(subject_image,bg_image,logo_image,banner_color): Add parameter and return types slatawa commented on 2024-05-10T07:31:23Z UPdated |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:31Z Line #4. # subject_image = Image.open(subject_image_path) # load image Remove commented out code slatawa commented on 2024-05-10T07:32:33Z removed
|
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:31Z Line #47. if position == "top right": This position should probably be an enum. slatawa commented on 2024-05-10T07:36:49Z UPDATED |
View / edit / reply to this conversation on ReviewNB holtskinner commented on 2024-03-27T15:26:32Z Line #1. import time move all imports to top of notebook slatawa commented on 2024-05-10T07:37:26Z updated |
…ive-ai into pr/slatawa/460
Description
Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
CONTRIBUTING
Guide.CODEOWNERS
for the file(s).nox -s format
from the repository root to format).Fixes #<issue_number_goes_here> 🦕