教程:使用控制台执行评估

了解如何使用 Google Google Cloud 控制台开始使用 Gen AI Evaluation Service。

准备工作

  1. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  2. Verify that billing is enabled for your Google Cloud project.

  3. Make sure that you have the following role or roles on the project: Storage Admin

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the identifier for a user in a workforce identity pool. For details, see Represent workforce pool users in IAM policies, or contact your administrator.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.

评估模型

如需评估模型,请执行以下操作:

  1. 在 Google Cloud 控制台中,前往“生成式 AI 评估”页面。

    前往“评估”页面

  2. 点击新评估,打开评估页面。

  3. 选择一个来源以加载用于评估的数据集:

    • 如需上传本地 CSV 或 JSONL 文件,请选择上传文件。数据集必须包含提示或要在提示模板中使用的记录,还可以选择性地包含模型回答。上限为 200 行。

    • 如需根据提示模板生成提示,请选择生成数据。 在创建数据集时,Gen AI Evaluation Service 会生成并填充您在提示模板中定义的变量。如需详细了解如何撰写提示模板,请参阅使用提示模板

      1. 提示模板字段中输入包含变量的提示模板。

      2. 如需为每个变量添加说明或指定要生成的样本数量,请展开定义变量和样本规模

      3. 点击生成数据集以生成提示。

  4. 根据您的提示生成并评估回答:

    1. 评估候选对象部分中,点击添加评估候选对象;如果候选对象已存在,请点击 修改,以定义要评估的提示和回答。例如,您可以指定来自已上传文件或生成的数据的提示或回答。

    2. 如需比较多个候选对象,请点击添加比较候选对象

    3. 指标部分,至少添加一个用于对候选回答质量进行评分的指标。如需详细了解指标类型,请参阅 Gen AI Evaluation Service 概览页面上的评估指标部分。

    对于某些自适应评分标准,您可以展开高级并提供自定义指令(例如 Evaluate the dataset on cultural sensitivity),从而引导系统根据每个提示生成评分标准。

    1. 名称和存储配置部分,指定评估的名称以及用于存储评估结果的 Cloud Storage 存储桶。
  5. 点击评估

查看评估结果

如需查看评估结果,请执行以下操作:

  1. 在 Google Cloud 控制台中,前往 GenAI 评估页面。

    前往“评估”页面

  2. 点击评估名称。

    对于评估数据集中的每个提示,系统都会显示回答以及评估结果。

评估合作伙伴模型

您可以使用 Gen AI Evaluation Service 评估以下合作伙伴模型:

  • Anthropic
  • Llama

合作伙伴模型通过 Gemini Enterprise Agent Platform Model Garden 提供支持。您必须先在 Model Garden 中启用合作伙伴模型,然后才能选择该模型进行评估。如需评估合作伙伴模型,请在评估设置期间从模型选择菜单中选择该模型。

价格

评估第三方模型的费用取决于在 Gemini Enterprise Agent Platform Model Garden 中进行模型推理所产生的任何费用。请参阅 Agent Platform 上的生成式 AI 的价格页面

后续步骤