googleapis / googleapis/python-aiplatform

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

Đang mở
#2,563 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
api: vertex-ai
Ngôn ngữ chính
Python
Star
905
Fork
465
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
44

Mô tả

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

```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.