From acb0a2fd2e43e8c5c8f7df3638d613a2be5c642d 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:45 +0000 Subject: [PATCH] Add missing `scores` parameter in `MLPutTrainedModelVocabularyRequest` (#2321) (#2324) 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 e76480f932..dddf63c74d 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -154353,6 +154353,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" + } + } + } } ] }, @@ -154383,7 +154405,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 f3ec2ba03a..7f3593d18a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -14307,6 +14307,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[] } }