Update python example (#477)

This commit is contained in:
Benjamin Trent 2022-06-28 13:01:49 -04:00 committed by GitHub
parent 23706e05b8
commit 947d4d22a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,12 +75,12 @@ Downloading: 100%|██████████| 249M/249M [00:23<00:00, 11.2MB
# Export the model in a TorchScript representation which Elasticsearch uses
>>> tmp_path = "models"
>>> Path(tmp_path).mkdir(parents=True, exist_ok=True)
>>> model_path, config_path, vocab_path = tm.save(tmp_path)
>>> model_path, config, vocab_path = tm.save(tmp_path)
# Import model into Elasticsearch
>>> es = elasticsearch.Elasticsearch("http://elastic:mlqa_admin@localhost:9200", timeout=300) # 5 minute timeout
>>> ptm = PyTorchModel(es, tm.elasticsearch_model_id())
>>> ptm.import_model(model_path, config_path, vocab_path)
>>> ptm.import_model(model_path=model_path, config_path=None, vocab_path=vocab_path, config=config)
100%|██████████| 63/63 [00:12<00:00, 5.02it/s]
------------------------