From d95b20d51fb7468eb01b3b73424a80ee1645e3f8 Mon Sep 17 00:00:00 2001 From: David Olaru Date: Tue, 31 Oct 2023 12:39:14 +0000 Subject: [PATCH] Add missing `scores` parameter in `MLPutTrainedModelVocabularyRequest` (#2321) 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) --- 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 eee852d945..932599a7ea 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -150191,6 +150191,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" + } + } + } } ] }, @@ -150221,7 +150243,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 8dd42f8fb2..0e55becac5 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -14217,6 +14217,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[] } }