googleapis / googleapis/python-aiplatform
`vertexai.init` always uses the default project instead of the project that is passed to it
- Lenguaje dominante
- Python
- Estrellas
- 905
- Forks
- 465
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 44
Descripción
#### Environment details
- OS type and version:
- Python version: 3.11.4
- pip version: 23.2.1
- `google-cloud-aiplatform` version: 1.32.0
#### Steps to reproduce
1. `vertexai.init(project=not_default_project_id)`
2. Watch vertexai use the default project id instead when `language_models.CodeGenerationModel.from_pretrained(...)` is called.
Below, you can see it is raising exception because the default project does not have Vertex AI enabled.
#### Stack trace
```
File "~/.pyenv/versions/vertex/lib/python3.11/site-packages/google/api_core/grpc_helpers.py", line 74, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.PermissionDenied: 403 Vertex AI API has not been used in project DEFAULT_PROJECT before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/aiplatform.googleapis.com/overview?project=DEFAULT_PROJECT then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. [links {
description: "Google developers console API activation"
url: "https://console.developers.google.com/apis/api/aiplatform.googleapis.com/overview?project=DEFAULT_PROJECT"
}
, reason: "SERVICE_DISABLED"
domain: "googleapis.com"
metadata {
key: "service"
value: "aiplatform.googleapis.com"
}
metadata {
key: "consumer"
value: "projects/DEFAULT_PROJECT"
}
]
```
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.