-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix: Update GetTokenCount.java #9334
base: main
Are you sure you want to change the base?
Conversation
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
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.
please, ensure that PR pass all checks
@@ -17,24 +17,27 @@ | |||
package vertexai.gemini; | |||
|
|||
// [START aiplatform_gemini_token_count] | |||
// [START generativeaionvertexai_gemini_token_count] |
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.
nit: is there a reason to duplicate region tags?
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.
@minherz the wrong region tag was used; correct region tag is the generativeai one. Once the region tag has been updated, doc CL would be issued and then the original region tag can be removed.
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.
In my experience this approach results in redundant and incorrect region tags in the code samples. It is because there is no good way to track documentation CL and following changes.. 🙁
If this code sample should not be used for aiplatform why not to remove the region tag now?
Alternatively why not to batch replacing the region tags to the doc CL?
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 dont understand the 'no good way to track comment'. can you please elaborate?
@davenportjw any idea why change in model name might cause the error tmpfs/docker/overlay2/85ba26e363cfea28217e7dc8e3c0363a0d8f95a8c884410d2f380c5b415db5f2/merged/sys/fs/cgroup/cpuset. |
It looks like you need to revise the input or to adjust the safety settings by updating the model with: SafetySetting safetySettings = SafetySetting.newBuilder()
.setThreshold(SafetySetting.HarmBlockThreshold.BLOCK_NONE)
.build();
GenerativeModel model = new GenerativeModel(modelName, vertexAI)
.withSafetySettings(safetySettings); |
Description
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
pom.xml
parent set to latestshared-configuration
mvn clean verify
requiredmvn -P lint checkstyle:check
requiredmvn -P lint clean compile pmd:cpd-check spotbugs:check
advisory only