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

[generative_ai]: Translation "with LLM" samples are not working anymore. #12997

Open
Valeriy-Burlaka opened this issue Dec 13, 2024 · 2 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@Valeriy-Burlaka
Copy link
Member

Valeriy-Burlaka commented Dec 13, 2024

In which file did you encounter the issue?

N/A — The samples in issue are written as Markdown. I worked on replacing them with actual Python samples.

Did you change the file? If so, how?

No.

Describe the issue

Both "Translation LLM" samples appear not working anymore (sample 1, sample 2).
The SDK fails to create the endpoint using the cloud-translate-text LLM provided in the documentation:

from google.cloud import aiplatform

endpoint = aiplatform.Endpoint('projects/PROJECT_ID/locations/LOCATION/publishers/google/models/cloud-translate-text')
...

Error:

Traceback (most recent call last):
  File "/...path/samples/pages/translation/translate_llm.py", line 26, in <module>
    translate()
  File "/..path/samples/pages/translation/translate_llm.py", line 12, in translate
    endpoint = aiplatform.Endpoint(endpoint)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/..path/.venv/lib/python3.12/site-packages/google/cloud/aiplatform/models.py", line 664, in __init__
    endpoint_name = utils.full_resource_name(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/..path/.venv/lib/python3.12/site-packages/google/cloud/aiplatform/utils/__init__.py", line 221, in full_resource_name
    resource_id_validator(resource_name)
  File "/..path/.venv/lib/python3.12/site-packages/google/cloud/aiplatform/utils/__init__.py", line 157, in validate_id
    raise ValueError(f"Resource {resource_id} is not a valid resource id.")
ValueError: Resource projects/[my-actual-project-id]/locations/us-central1/publishers/google/models/cloud-translate-text is not a valid resource id.

Environment

google-cloud-aiplatform==1.71.1

Full:

% python -V
Python 3.12.6

% pip list | grep google
google-api-core               2.19.1
google-auth                   2.34.0
google-cloud-aiplatform       1.71.1
google-cloud-bigquery         3.25.0
google-cloud-core             2.4.1
google-cloud-resource-manager 1.12.5
google-cloud-storage          2.18.2
google-crc32c                 1.5.0
google-resumable-media        2.7.2
googleapis-common-protos      1.64.0
grpc-google-iam-v1            0.13.1
@Valeriy-Burlaka Valeriy-Burlaka added triage me I really want to be triaged. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Dec 13, 2024
@Valeriy-Burlaka Valeriy-Burlaka self-assigned this Dec 13, 2024
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Dec 13, 2024
@glasnt
Copy link
Contributor

glasnt commented Dec 15, 2024

Can you please provide your pip list to understand which packages you're using, to identify if that is related? Thank you in advance.

@Valeriy-Burlaka
Copy link
Member Author

@glasnt, thank you for checking this out! — I updated the issue with my environment info.

I just noticed that the "Translate text" guide page, which hosted these samples, has changed completely and isn't listing any code samples anymore. Is this expected?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants