Skip to content

Commit c1e54db

Browse files
committed
doc(nbs): add tip on attaching existing endpoint
Help save time when rebooting kernel for notebook 2
1 parent 9684505 commit c1e54db

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

notebooks/2. Model Training.ipynb

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,28 @@
709709
"source": [
710710
"## Using the Model\n",
711711
"\n",
712-
"Once the deployment is complete, we're ready to try it out with some real-time requests!\n",
713-
"\n",
712+
"Once the deployment is complete, we're ready to try it out with some real-time requests!"
713+
]
714+
},
715+
{
716+
"cell_type": "code",
717+
"execution_count": null,
718+
"metadata": {},
719+
"outputs": [],
720+
"source": [
721+
"# As with estimators, you can attach the notebook to a previously deployed endpoint like this:\n",
722+
"# from sagemaker.huggingface import HuggingFacePredictor\n",
723+
"# predictor = HuggingFacePredictor(\n",
724+
"# \"layoutlm-cfpb-hf-2021-09-02-01-08-11-234\",\n",
725+
"# serializer=sagemaker.serializers.JSONSerializer(),\n",
726+
"# deserializer=sagemaker.deserializers.JSONDeserializer(),\n",
727+
"# )"
728+
]
729+
},
730+
{
731+
"cell_type": "markdown",
732+
"metadata": {},
733+
"source": [
714734
"### Making requests and rendering results\n",
715735
"\n",
716736
"This model accepts Textract-like JSON (e.g. as returned by [AnalyzeDocument](https://docs.aws.amazon.com/textract/latest/dg/API_AnalyzeDocument.html#API_AnalyzeDocument_ResponseSyntax) or [DetectDocumentText](https://docs.aws.amazon.com/textract/latest/dg/API_DetectDocumentText.html#API_DetectDocumentText_ResponseSyntax) APIs) and classifies each `WORD` [block](https://docs.aws.amazon.com/textract/latest/dg/API_Block.html) according to the entity classes we defined earlier: Returning the same JSON with additional fields added to indicate the predictions.\n",

0 commit comments

Comments
 (0)