-
Notifications
You must be signed in to change notification settings - Fork 80
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
TypeError: MlClient.put_trained_model() got an unexpected keyword argument 'prefix_strings' when use eland to import model with "--ingest-prefix" #2448
Comments
Thanks @qubit4zj for the issue, and sorry for the double transfer. The Python client is generated from this repository, and elasticsearch-specification/specification/ml/put_trained_model/MlPutTrainedModelRequest.ts Lines 49 to 105 in 4e97d99
@elastic/ml-core Would one of you be able to fix the definition here? Thank you 🙏 |
Thanks for the bug report @qubit4zj If you have Elasticsearch version 8.12 then the https://www.elastic.co/guide/en/machine-learning/8.12/ml-nlp-e5.html |
Thanks David for your help! @qubit4zj This will be in the next version of elasticsearch-py that will be released in a few weeks. |
@pquentin @davidkyle Thanks for your update! I'll try the new version once it's ready. |
Now that this is in the main branch of elasticsearch-py, you can also test it using |
Support prefix_strings for MlClient.put_trained_model()
Use eland to import model intfloat/multilingual-e5-small with command:
STAGE:2024-03-13 06:23:42 1:1 ActivityProfilerController.cpp:294] Completed Stage: Warm Up
STAGE:2024-03-13 06:23:43 1:1 ActivityProfilerController.cpp:300] Completed Stage: Collection
2024-03-13 06:23:48,172 INFO : Creating model with id 'test'
Traceback (most recent call last):
File "/usr/local/bin/eland_import_hub_model", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/eland/cli/eland_import_hub_model.py", line 295, in main
ptm.put_config(config=config)
File "/usr/local/lib/python3.10/site-packages/eland/ml/pytorch/_pytorch_model.py", line 78, in put_config
self._client.ml.put_trained_model(model_id=self.model_id, **config_map)
File "/usr/local/lib/python3.10/site-packages/elasticsearch/sync/client/utils.py", line 426, in wrapped
return api(*args, **kwargs)
TypeError: MlClient.put_trained_model() got an unexpected keyword argument 'prefix_strings'
Elasticsearch version (
bin/elasticsearch --version
):elasticsearch-py
version (elasticsearch.__versionstr__
): 8.12.0Please make sure the major version matches the Elasticsearch server you are running.
Description of the problem including expected versus actual behavior:
Please add "prefix_strings" as input parameter to:
https://github.com/elastic/elasticsearch-py/blob/main/elasticsearch/_sync/client/ml.py#L3654
Steps to reproduce:
The text was updated successfully, but these errors were encountered: