generative-ai icon indicating copy to clipboard operation
generative-ai copied to clipboard

[Bug]: Prompt Optmizer using invalid model

Open ycastorium opened this issue 7 months ago • 7 comments

File Name

https://github.com/GoogleCloudPlatform/generative-ai/blob/main/gemini/prompts/prompt_optimizer/vertex_ai_prompt_optimizer_ui.ipynb

What happened?

Looks like somewhere in the code is trying to use gemini 1.5 pro and referencing it through an invalid url.

Relevant log output

Detailed error: Error: The job failed: 404 Publisher Model `projects/XXXXX/locations/us-central1/publishers/google/models/gemini-1.5-pro-002` was not found or your project does not have access to it.

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

ycastorium avatar May 22 '25 09:05 ycastorium

Is there any timeline for the fix? Unfortunately, Gemini 1.5 Pro is used in the pipeline of the optimizer despite the model removal. I couldn't fix this myself since it seems that the usage of the model is hard coded in the docker image of the optimizer. Are there any workarounds?

GeeekyBoy avatar May 26 '25 07:05 GeeekyBoy

I also came across this. I thought it might be because it's retired (https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versions#legacy-stable) but it's not.

I also threw the stack trace into Gemini:

Stack Trace Analysis:

The provided stack trace indicates the error's origin and propagation through the application:

Origin: The error surfaces within a Python application, seemingly part of an optimization process (optimize_main.par/..., instruction_optimizer.py). Libraries Involved: The trace shows calls progressing through: Google API core libraries (e.g., google.api_core.grpc_helpers, google.api_core.gapic_v1.method). Google Cloud AI Platform client libraries (e.g., google.cloud.aiplatform.vertexai.generative_models._generative_models.py, google.cloud.aiplatform.aiplatform_v1beta1.services.prediction_service.client.py). A framework potentially named onetwo (various modules under onetwo.core, onetwo.builtins, etc.), which appears to handle the model interaction logic. Point of Failure: The exception is raised when the application attempts to make a generate_content call to the Vertex AI service: The call sequence includes self._text_generation_model.generate_content(...) within google/cloud/aiplatform/vertexai/generative_models/_generative_models.py. This, in turn, calls self._prediction_client.generate_content(request=request) within the same module. Exception Type: The immediate exception caught and re-raised by the Google API client is google.api_core.exceptions.NotFound: 404 .... This wraps a lower-level _open_source_grpc._channel._InactiveRpcError with status = StatusCode.NOT_FOUND. This confirms that the "Not Found" status was returned by the remote gRPC service.

raybell-md avatar May 27 '25 02:05 raybell-md

I have the same problem, setting the target_model to another gemini version did not help...

aycaecemgul avatar May 27 '25 14:05 aycaecemgul

@want-to-be-relaxed or @inardini can you look into this?

holtskinner avatar May 27 '25 15:05 holtskinner

Sorry for the inconvenience. The prompt optimizer was using Gemini 1.5 Pro as the optimizer model to rewrite the prompts. Since Gemini 1.5 Pro is deprecated, we just released a fix using a more recent model.

hootan-na avatar May 27 '25 19:05 hootan-na

Can this be closed?

Has anyone validated?

raybell-md avatar Jun 07 '25 01:06 raybell-md

I have tried it after @hootan-na's comment, and it was working. ✅

GeeekyBoy avatar Jun 07 '25 13:06 GeeekyBoy