Closed Thoughtseize1 closed 1 month ago
All new files without tests yet
Samples for this page
I have issues with two files that use the endpoint
and predict
methods, specifically when working with the Vertex AI API and translation LLM
and Custom translations
.
Both examples are designed to use an endpoint
. However, when I try to replicate the sample code, I encounter the following error:
ValueError: Resource projects/PROJECT/locations/us-central1/publishers/google/models/text-translation is not a valid resource ID.
Indeed, such an endpoint
does not exist, and the model is not deployed there. When I attempt to use an existing endpoint
with a deployed model (for example, I used code-bison
since it was already deployed on my endpoint), everything works fine.
Additionally, the existing Text Translation model has a different Model ID: publishers/google/models/text-translation
.
It also doesn't seem like this model ID
can be used with the endpoint
.
How should I proceed? Which endpoint should be used in this scenario?
Furthermore, I made an assumption and created a file translate_with_llm_example.py, where I outlined how I envision using a specific endpoint from the list with the client. Could you please advise on the correct approach?
translate_with_llm.py
translate_with_custom translations.py
Here is the summary of changes.
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:
The decision was made to leave only work samples and update this documentation page.
Description
4 Samples for this page:
translate_v3_translate_text.py
✅translate_with_gemini.py
✅translate_with_llm.py
❌ Errors - Errors - Old approachtranslate_with_custom translations.py
❌ Errors - Errors - Old approachChecklist
nox -s py-3.9
(see Test Environment Setup)nox -s lint
(see Test Environment Setup)