googleapis / googleapis/python-aiplatform

`vertexai.init` always uses the default project instead of the project that is passed to it

オープン
#2,563 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: vertex-ai
主要言語
Python
スター
905
フォーク
465
平均マージ
1日 13時間
マージ済み PR(30日)
44

説明

#### 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"
}
]

```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。