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: New text Generation Samples - Batch Predict #12543

Merged
merged 5 commits into from
Sep 3, 2024

Conversation

Thoughtseize1
Copy link
Contributor

@Thoughtseize1 Thoughtseize1 commented Aug 30, 2024

I noticed that some samples were missing from our repository. This PR addresses this by adding 2 new samples (listed below) and introducing an extendable test structure.

File Documentation Link Region_tag
batch_code_predict.py Get batch code predictions aiplatform_batch_code_predict
batch_text_predict.py Get batch text generations aiplatform_batch_text_predict

For proper testing, please upload the 2 files to the test environment of the test project with the .JSNOL extension and provide the paths to the model prompts in the format gs://[cloud-samples-data]/[PATH_TO_FILE].jsonl

.json example for batch_code_predict.py. Possible name: prompt_for_batch_code_predict.jsonl

{"prefix":"Write a Python function that determines if a year is a leap year:"}
{"prefix":"Write a unit test for Python code that reverses a string:"}

.json example for batch_text_predict.py. Possible name:prompt_for_batch_text_predict.jsonl

{"prompt":"Give a short description of a machine learning model:"}
{"prompt":"Best recipe for banana bread:"}

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Aug 30, 2024
@Thoughtseize1 Thoughtseize1 marked this pull request as ready for review August 30, 2024 15:29
@Thoughtseize1 Thoughtseize1 requested review from a team as code owners August 30, 2024 15:29
Copy link

snippet-bot bot commented Aug 30, 2024

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@m-strzelczyk
Copy link
Contributor

I made the following:

  • gs://cloud-samples-data/batch/prompt_for_batch_code_predict.jsonl
  • gs://cloud-samples-data/batch/prompt_for_batch_text_predict.jsonl

generative_ai/batch_predict/batch_code_predict.py Outdated Show resolved Hide resolved
generative_ai/batch_predict/batch_code_predict.py Outdated Show resolved Hide resolved
generative_ai/batch_predict/batch_text_predict.py Outdated Show resolved Hide resolved
generative_ai/batch_predict/batch_text_predict.py Outdated Show resolved Hide resolved
@Thoughtseize1 Thoughtseize1 merged commit b679b73 into main Sep 3, 2024
15 checks passed
@Thoughtseize1 Thoughtseize1 deleted the Hardcoded-samples-to-be-migrated-batch-predict branch September 3, 2024 11:56
@Thoughtseize1 Thoughtseize1 changed the title feat: New text Generation Samples feat: New text Generation Samples - Batch Predict Oct 8, 2024
riathakkar pushed a commit to riathakkar/python-docs-samples that referenced this pull request Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants