-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
chore: update embedding sample to be more developer friendly #11290
Conversation
vector = embeddings[0].values | ||
print(f"Length of Embedding Vector: {len(vector)}") |
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.
removed loop here, really no need to loop if we are only returning 1 embedding...
@yil532 curious what you think on this? (saw you as a previous contributor to this file) 😄 |
FYI: Test that is failing has nothing to do with code touched in this PR |
Looks like test that was blocking this PR was fixed as part of #11313 |
Note: I am a Googler on a different team that noticed this sample was slightly confusing when I tried to use it so putting this PR up as a potential improvement.
As a developer wanting to copy/paste this sample into my workload I would expect it to take in an input string and then get the embedding for it? This is what the notebook example for this already does... https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/generative_ai/text_embedding_new_api.ipynb