From 3c7bebe63f1897d156c74b6f2779465d1b0552da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Tue, 10 May 2022 13:04:25 +0200 Subject: [PATCH] [DOCS] Adds authentication methods to NLP import guide (#2132) Co-authored-by: David Olaru (cherry picked from commit bfa78f980f610cbac55d9a6346b423d536800f1f) --- .../ml/nlp/ml-nlp-deploy-models.asciidoc | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/docs/en/stack/ml/nlp/ml-nlp-deploy-models.asciidoc b/docs/en/stack/ml/nlp/ml-nlp-deploy-models.asciidoc index c4328babc..2b523984c 100644 --- a/docs/en/stack/ml/nlp/ml-nlp-deploy-models.asciidoc +++ b/docs/en/stack/ml/nlp/ml-nlp-deploy-models.asciidoc @@ -50,7 +50,8 @@ Eland encapsulates both the conversion of Hugging Face transformer models to their TorchScript representations and the chunking process in a single Python method; it is therefore the recommended import method. -. Install the {eland-docs}/installation.html[Eland Python client] with PyTorch extra dependencies. +. Install the {eland-docs}/installation.html[Eland Python client] with PyTorch +extra dependencies. + -- [source,shell] @@ -63,23 +64,58 @@ python -m pip install 'eland[pytorch]' . Run the `eland_import_hub_model` script. For example: + -- -[source,js] +[source, shell] -------------------------------------------------- -eland_import_hub_model --url \ <1> +eland_import_hub_model \ <1> --hub-model-id elastic/distilbert-base-cased-finetuned-conll03-english \ <2> ---task-type ner <3> +--task-type ner \ <3> -------------------------------------------------- // NOTCONSOLE -- - -<1> Specify the URL to access your cluster. For example, -`https://:@:`. +<1> Use an authentication method to access your cluster. Refer to +<> to learn more. <2> Specify the identifier for the model in the Hugging Face model hub. <3> Specify the type of NLP task. Supported values are `fill_mask`, `ner`, `text_classification`, `text_embedding`, and `zero_shot_classification`. For more details, refer to https://github.com/elastic/eland#nlp-with-pytorch. +[discrete] +[[authentication]] +=== Authentication methods + +The following authentication options are available when using the import script: + +* username/password authentication (specified with the `-u` and `-p` options): + +[source, shell] +-------------------------------------------------- +eland_import_hub_model --url https://: -u -p +-------------------------------------------------- + +* username/password authentication (embedded in the URL): + +[source, shell] +-------------------------------------------------- +eland_import_hub_model --url https://:@: +-------------------------------------------------- + +* Elastic Cloud users can use Cloud ID instead of the URL (`--url` + and `--cloud-id` are mutually exclusive): + +[source, shell] +-------------------------------------------------- +eland_import_hub_model --cloud-id -u -p +-------------------------------------------------- + +* API key authentication: + +[source, shell] +-------------------------------------------------- +eland_import_hub_model --url https://: --es-api-key +-------------------------------------------------- + + [discrete] [[ml-nlp-deploy-model]] == Deploy the model in your cluster