|
52 | 52 | },
|
53 | 53 | {
|
54 | 54 | "metadata": {},
|
55 |
| - "source": "%pip install -q \"labelbox[data]\"", |
| 55 | + "source": "%pip install -q --upgrade \"labelbox[data]\"", |
56 | 56 | "cell_type": "code",
|
57 | 57 | "outputs": [],
|
58 | 58 | "execution_count": null
|
|
134 | 134 | "### Set Up Model Chat Evaluation Project\n",
|
135 | 135 | "You do not have to create data rows with a model evaluation project; instead, they are generated for you when you create the project. The method you use to create your project is `client.create_model_evaluation_project`, which takes the same parameters as the traditional `client.create_project` but with a few specific additional parameters. \n",
|
136 | 136 | "\n",
|
137 |
| - "__Setting up different models that you are evaluating can only be done inside the Labelbox platform__\n", |
138 |
| - "\n", |
139 | 137 | "#### Parameters\n",
|
140 | 138 | "When using `client.create_model_evaluation_project` the following parameters are needed:\n",
|
141 | 139 | "\n",
|
|
162 | 160 | "outputs": [],
|
163 | 161 | "execution_count": null
|
164 | 162 | },
|
| 163 | + { |
| 164 | + "metadata": {}, |
| 165 | + "source": [ |
| 166 | + "## Setting Up Model Configs\n", |
| 167 | + "You can create, delete, attach and remove model configs from your Model Chat Evaluation project through the Labelbox-Python SDK. These are the model configs that you will be evaluating for your responses. " |
| 168 | + ], |
| 169 | + "cell_type": "markdown" |
| 170 | + }, |
| 171 | + { |
| 172 | + "metadata": {}, |
| 173 | + "source": [ |
| 174 | + "### Creating Model Configs\n", |
| 175 | + "The main method associated with creating a model config is `client.create_model_config`. This method takes the following parameters:\n", |
| 176 | + "\n", |
| 177 | + "- `name`: Name of the model config.\n", |
| 178 | + "\n", |
| 179 | + "- `model_id`: The ID of the model to configure. You must obtain this through the UI by navigating to the Model tab, selecting the model you are trying to use, and copying the id inside the URL. For supported models, visit the [Model chat evaluation page](https://docs.labelbox.com/docs/model-chat-evaluation#supported-annotation-types).\n", |
| 180 | + "\n", |
| 181 | + "- `inference_params`: JSON of model configuration parameters. This will vary depending on the model you are trying to set up. It is recommended to first set up a model config inside the UI to learn all the associated parameters.\n", |
| 182 | + "\n", |
| 183 | + "For the example below, we will be setting up a Google Gemini 1.5 Pro model config." |
| 184 | + ], |
| 185 | + "cell_type": "markdown" |
| 186 | + }, |
| 187 | + { |
| 188 | + "metadata": {}, |
| 189 | + "source": "MODEL_ID = \"270a24ba-b983-40d6-9a1f-98a1bbc2fb65\"\n\ninference_params = {\"max_new_tokens\": 1024, \"use_attachments\": True}\n\nmodel_config = client.create_model_config(\n name=\"Example Model Config\",\n model_id=MODEL_ID,\n inference_params=inference_params,\n)", |
| 190 | + "cell_type": "code", |
| 191 | + "outputs": [], |
| 192 | + "execution_count": null |
| 193 | + }, |
| 194 | + { |
| 195 | + "metadata": {}, |
| 196 | + "source": [ |
| 197 | + "### Attaching Model Config to Project\n", |
| 198 | + "You can attach and remove model configs to your project using `project.add_model_config` or `project.remove_model_config`. Both methods take just a `model_config` ID." |
| 199 | + ], |
| 200 | + "cell_type": "markdown" |
| 201 | + }, |
| 202 | + { |
| 203 | + "metadata": {}, |
| 204 | + "source": "project.add_model_config(model_config.uid)", |
| 205 | + "cell_type": "code", |
| 206 | + "outputs": [], |
| 207 | + "execution_count": null |
| 208 | + }, |
| 209 | + { |
| 210 | + "metadata": {}, |
| 211 | + "source": [ |
| 212 | + "### Delete Model Config\n", |
| 213 | + "You can also delete model configs using the `client.delete_model_config`. You just need to pass in the `model_config` ID in order to delete your model config. You can obtain this ID from your created model config above or get the model configs directly from your project using `project.project_model_configs` and then iterating through the list of model configs attached to your project. Uncomment the code below to delete your model configs. " |
| 214 | + ], |
| 215 | + "cell_type": "markdown" |
| 216 | + }, |
| 217 | + { |
| 218 | + "metadata": {}, |
| 219 | + "source": "# model_configs = project.project_model_configs()\n\n# for model_config in model_configs:\n# client.delete_model_config(model_config.uid)", |
| 220 | + "cell_type": "code", |
| 221 | + "outputs": [], |
| 222 | + "execution_count": null |
| 223 | + }, |
| 224 | + { |
| 225 | + "metadata": {}, |
| 226 | + "source": [ |
| 227 | + "**To finish setting up your MCE project, you will need to navigate to your project overview inside the Labelbox platform and select _Complete setup_ on the left side panel**" |
| 228 | + ], |
| 229 | + "cell_type": "markdown" |
| 230 | + }, |
165 | 231 | {
|
166 | 232 | "metadata": {},
|
167 | 233 | "source": [
|
|
0 commit comments