You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Vertex AI Text Embedding Model时遭遇403 DISABLED_SERVICE权限错误的解决求助

Vertex AI Text Embedding Model时遭遇403 DISABLED_SERVICE权限错误的解决求助

我正在尝试运行GCP上关于文本嵌入的教程,但下面的代码片段无法运行(错误提示服务已禁用,但我的GCP项目中Vertex AI API实际上是启用状态):

from vertexai.language_models import TextEmbeddingModel
import vertexai

vertexai.init(project="MY_PROJET_ID", location="europe-west1")

texts = ["banana muffins? ", "banana bread? banana muffins?"]
dimensionality = 256
task = "RETRIEVAL_DOCUMENT"


model = TextEmbeddingModel.from_pretrained("text-multilingual-embedding-002")

使用的依赖版本:google-cloud-aiplatform = "1.74.0",Python版本为3.11。

权限错误截图

错误输出(提示DISABLED_SERVICE):

PermissionDenied: 403 Your application is authenticating by using local Application Default Credentials. The aiplatform.googleapis.com API requires a quota project, which is not set by default. To learn how to set your quota project, see https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds . [reason: "SERVICE_DISABLED"
domain: "googleapis.com"
metadata {
  key: "service"
  value: "aiplatform.googleapis.com"
}
metadata {
  key: "consumer"
  value: "projects/764086051850"
}

不过我可以正常使用Vertex AI的其他服务,比如GenerativeModels。我怀疑代码使用了错误的项目764086051850而不是我自己的项目,但我不知道在哪里修改这个设置。有没有人知道如何解决这个问题?

备注:内容来源于stack exchange,提问作者maggle

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 16:29:36