googleapis / googleapis/python-aiplatform

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

未关闭
#2,563 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api: vertex-ai
主要语言
Python
星标
905
派生
465
平均合并
1 天 13 小时
30 天内合并 PR
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"
}
]

```

贡献指南

打开贡献指南

调研方向

Start at the vertexai.init entry point and trace how its project argument reaches language_models.CodeGenerationModel.from_pretrained. Reproduce with a non-default project and inspect the resulting API request or error metadata. Done means the passed project, rather than the default project, is used consistently.

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
machine-learning
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。