|
259 | 259 | "print(result)"
|
260 | 260 | ]
|
261 | 261 | },
|
| 262 | + { |
| 263 | + "metadata": {}, |
| 264 | + "cell_type": "code", |
| 265 | + "outputs": [], |
| 266 | + "execution_count": null, |
| 267 | + "source": [ |
| 268 | + "# Update existing endpoint\n", |
| 269 | + "predictor = model_builder.deploy(\n", |
| 270 | + " endpoint_name=f\"{alias}-xgboost-deploy-realtime\",\n", |
| 271 | + " initial_instance_count=3,\n", |
| 272 | + " update_endpoint=True, # Updates existing endpoint\n", |
| 273 | + ")" |
| 274 | + ], |
| 275 | + "id": "74b554744208fa27" |
| 276 | + }, |
262 | 277 | {
|
263 | 278 | "cell_type": "markdown",
|
264 | 279 | "id": "fbd0e6f6e92d0aeb",
|
|
285 | 300 | "print(result)"
|
286 | 301 | ]
|
287 | 302 | },
|
| 303 | + { |
| 304 | + "metadata": {}, |
| 305 | + "cell_type": "code", |
| 306 | + "outputs": [], |
| 307 | + "execution_count": null, |
| 308 | + "source": [ |
| 309 | + "predictor = model_builder.deploy(\n", |
| 310 | + " endpoint_name=f\"{alias}-xgboost-deploy-serverless\",\n", |
| 311 | + " inference_config=ServerlessInferenceConfig(memory_size_in_mb=1024),\n", |
| 312 | + " update_endpoint=True,\n", |
| 313 | + ")\n", |
| 314 | + "\n", |
| 315 | + "sklearn_input = np.array([1.0, 2.0, 3.0, 4.0])\n", |
| 316 | + "result = predictor.predict(sklearn_input)\n", |
| 317 | + "print(result)" |
| 318 | + ], |
| 319 | + "id": "305dca02732c0eac" |
| 320 | + }, |
288 | 321 | {
|
289 | 322 | "cell_type": "markdown",
|
290 | 323 | "id": "93818038782f105d",
|
|
317 | 350 | "print(result)"
|
318 | 351 | ]
|
319 | 352 | },
|
| 353 | + { |
| 354 | + "metadata": {}, |
| 355 | + "cell_type": "code", |
| 356 | + "outputs": [], |
| 357 | + "execution_count": null, |
| 358 | + "source": [ |
| 359 | + "predictor = model_builder.deploy(\n", |
| 360 | + " endpoint_name=f\"{alias}-xgboost-deploy-async\",\n", |
| 361 | + " inference_config=AsyncInferenceConfig(\n", |
| 362 | + " output_path=s3_path_join(\n", |
| 363 | + " \"s3://\", bucket, f\"{default_bucket_prefix_path}async_inference/update_output_prefix\"\n", |
| 364 | + " )\n", |
| 365 | + " ),\n", |
| 366 | + " update_endpoint=True,\n", |
| 367 | + ")\n", |
| 368 | + "\n", |
| 369 | + "sklearn_input = np.array([1.0, 2.0, 3.0, 4.0])\n", |
| 370 | + "result = predictor.predict(sklearn_input)\n", |
| 371 | + "print(result)" |
| 372 | + ], |
| 373 | + "id": "bbb56866e2faf7b" |
| 374 | + }, |
320 | 375 | {
|
321 | 376 | "cell_type": "markdown",
|
322 | 377 | "id": "2ff3e043b5f5f8d7",
|
|
0 commit comments