From 7111a05de3e0e048aee03309566338efb495ce1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:42:48 +0000 Subject: [PATCH] Add missing `scores` parameter in `MLPutTrainedModelVocabularyRequest` (#2321) (#2323) This adds the missing scores parameter that was introduced in v8.9.0. [Docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/put-trained-model-vocabulary.html#ml-put-trained-model-vocabulary-request-body) say: > (Optional, array) Vocabulary value scores used by sentence-piece tokenization. Must have the same length as vocabulary. Required for unigram sentence-piece tokenized models like XLMRoberta and T5. (cherry picked from commit e279583a47508af40eb07b84694c5aae7885aa09) Co-authored-by: David Olaru --- output/schema/schema.json | 24 ++++++++++++++++++- output/typescript/types.ts | 1 + .../MlPutTrainedModelVocabularyRequest.ts | 8 +++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 3cbb5bf14a..009e7920fb 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -153534,6 +153534,28 @@ } } } + }, + { + "availability": { + "serverless": {}, + "stack": { + "since": "8.9.0" + } + }, + "description": "The optional vocabulary value scores if required by the tokenizer.", + "name": "scores", + "required": false, + "since": "8.9.0", + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + } } ] }, @@ -153564,7 +153586,7 @@ } ], "query": [], - "specLocation": "ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyRequest.ts#L23-L52" + "specLocation": "ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyRequest.ts#L24-L60" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 25845e4a36..49c54acb2b 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -14291,6 +14291,7 @@ export interface MlPutTrainedModelVocabularyRequest extends RequestBase { body?: { vocabulary: string[] merges?: string[] + scores?: double[] } } diff --git a/specification/ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyRequest.ts b/specification/ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyRequest.ts index 2dd8894005..c202fb7a3a 100644 --- a/specification/ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyRequest.ts +++ b/specification/ml/put_trained_model_vocabulary/MlPutTrainedModelVocabularyRequest.ts @@ -19,6 +19,7 @@ import { RequestBase } from '@_types/Base' import { Id } from '@_types/common' +import { double } from '@_types/Numeric' /** * Creates a trained model vocabulary. @@ -48,5 +49,12 @@ export interface Request extends RequestBase { * @availability serverless */ merges?: string[] + + /** + * The optional vocabulary value scores if required by the tokenizer. + * @availability stack since=8.9.0 + * @availability serverless + */ + scores?: double[] } }