瞭解如何透過 Google Cloud 控制台開始使用 Gen AI 評估服務。 Google Cloud
事前準備
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
- 
    
    
      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
      (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
 
- 
  
    Verify that billing is enabled for your Google Cloud project. 
- 
    
        Make sure that you have the following role or roles on the project: Storage Admin Check for the roles- 
              In the Google Cloud console, go to the IAM page. Go to IAM
- Select the project.
- 
              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. 
- 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- 
              In the Google Cloud console, go to the IAM page. 前往 IAM
- 選取專案。
- 按一下「授予存取權」。
- 
              在「New principals」(新增主體) 欄位中,輸入您的使用者 ID。 這通常是 Google 帳戶的電子郵件地址。 
- 在「Select a role」(選取角色) 清單中,選取角色。
- 如要授予其他角色,請按一下 「新增其他角色」,然後新增每個其他角色。
- 按一下 [Save]。
 
- 
              
- 
    
    
      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
      (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
 
- 
  
    Verify that billing is enabled for your Google Cloud project. 
- 
    
        Make sure that you have the following role or roles on the project: Storage Admin Check for the roles- 
              In the Google Cloud console, go to the IAM page. Go to IAM
- Select the project.
- 
              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. 
- 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- 
              In the Google Cloud console, go to the IAM page. 前往 IAM
- 選取專案。
- 按一下「授予存取權」。
- 
              在「New principals」(新增主體) 欄位中,輸入您的使用者 ID。 這通常是 Google 帳戶的電子郵件地址。 
- 在「Select a role」(選取角色) 清單中,選取角色。
- 如要授予其他角色,請按一下 「新增其他角色」,然後新增每個其他角色。
- 按一下 [Save]。
 
- 
              
- 前往 Google Cloud 控制台的「Gen AI Evaluation」頁面。 
- 按一下「新評估」,開啟評估頁面。 
- 在「定義評估資料集」中,選取下列任一選項: - 上傳檔案:按一下「上傳」即可上傳 CSV 或 JSONL 檔案。資料集應包含提示或記錄,以用於提示範本和選用模型回覆,最多 200 列。 
- 產生資料:輸入提示範本,引導 Gen AI Evaluation Service 生成資料集。系統會產生您在提示範本中定義的變數,並填入資料集。詳情請參閱「使用提示範本」。 - 定義要產生的變數:指定要產生的變數,並提供變數說明,引導生成作業。視需要按一下「新增其他變數說明」。 
- 輸入要生成的「樣本數」。 
- 按一下「Generate and preview dataset」(產生及預覽資料集),根據提示範本和變數顯示產生的資料集。如要調整資料集,可以為變數說明新增更多詳細資料,然後按一下「重新生成」。 
 
- 使用模型記錄:使用所選模型記錄流量的提示和回覆快照。如要在 Vertex AI 中使用這個選項,您必須在已部署的模型上啟用要求/回應記錄。如果您剛啟用記錄功能,請等待一段時間,讓系統累積足夠的樣本。 - 選取要記錄流量的「模型」和「區域」。您必須已在所選模型和區域中啟用記錄功能。 
- 輸入「Sampling count」(取樣次數)。 
- (選用) 啟用「依提示範本篩選」,只使用與「提示範本」相符的記錄。如果您將所選模型用於各種用途,並想評估特定用途,這項功能就非常實用。 
 
 
- 在「定義要評估的模型回覆」部分,選取下列任一選項: - 來自資料集 (只有在您為「定義評估資料集」選取「上傳檔案」時可用):如要使用上傳資料集中的其中一個欄位做為回應,請選取「回應資料欄」。 
- 來自模型 (僅在為「定義評估資料集」選取「使用模型記錄」時提供):如果您使用模型記錄做為評估資料集,生成式 AI 評估服務會使用模型記錄中的模型回應。 
- 通話模型:選取模型。Gen AI Evaluation Service 會在所選模型上執行提示,並使用回覆內容進行評估。 
 
- (選用) 如要使用自動生成的評估指標,可以指定自訂指令,引導系統根據每個提示生成評分量表。例如 - Evaluate the dataset on cultural sensitivity to the countries {name}。詳情請參閱「定義評估指標」。
- 在「Name and output directory」(名稱和輸出目錄) 中輸入下列資訊: - 評估名稱:輸入評估名稱。 
- 輸出私人資料路徑:輸入要儲存評估結果的 Cloud Storage bucket 名稱,或按一下「瀏覽」選擇 bucket。 
 
- 按一下「評估」。 
- 前往 Google Cloud 控制台的「Gen AI Evaluation」頁面。 
- 按一下「Evaluation name」(評估作業名稱)。 
- 評估資料集中的每個提示都會顯示模型的回覆和評估結果。 
評估模型
如要評估模型,請按照下列步驟操作:
查看評估結果
如要查看評估結果,請按照下列步驟操作: