Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.2] [DOCS] Adds authentication methods to NLP import guide (backport #2132) #2133

Merged
merged 1 commit into from
May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 43 additions & 7 deletions docs/en/stack/ml/nlp/ml-nlp-deploy-models.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 <clusterUrl> \ <1>
eland_import_hub_model <authentication> \ <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://<user>:<password>@<hostname>:<port>`.
<1> Use an authentication method to access your cluster. Refer to
<<authentication>> 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://<hostname>:<port> -u <username> -p <password>
--------------------------------------------------

* username/password authentication (embedded in the URL):

[source, shell]
--------------------------------------------------
eland_import_hub_model --url https://<user>:<password>@<hostname>:<port>
--------------------------------------------------

* 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 <cloud-id> -u <username> -p <password>
--------------------------------------------------

* API key authentication:

[source, shell]
--------------------------------------------------
eland_import_hub_model --url https://<hostname>:<port> --es-api-key <api-key>
--------------------------------------------------


[discrete]
[[ml-nlp-deploy-model]]
== Deploy the model in your cluster
Expand Down