Skip to content

Commit

Permalink
[ML] Adding text embedding byte representation (#2411)
Browse files Browse the repository at this point in the history
* Adding text embedding byte representation

* Removing semi-colon
  • Loading branch information
jonathan-buttner authored Feb 8, 2024
1 parent 90b0967 commit 4cb8434
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 3 deletions.
59 changes: 57 additions & 2 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion specification/inference/_types/Results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { float } from '@_types/Numeric'
import { float, byte } from '@_types/Numeric'
import { Dictionary } from '@spec_utils/Dictionary'

/**
Expand All @@ -36,6 +36,19 @@ export class SparseEmbeddingResult {
embedding: SparseVector
}

/**
* Text Embedding results containing bytes are represented as Dense
* Vectors of bytes.
*/
export type DenseByteVector = Array<byte>

/**
* The text embedding result object for byte representation
*/
export class TextEmbeddingByteResult {
embedding: DenseByteVector
}

/**
* The text embedding result object
*/
Expand All @@ -48,6 +61,7 @@ export class TextEmbeddingResult {
* @variants container
*/
export class InferenceResult {
text_embedding_bytes?: Array<TextEmbeddingByteResult>
text_embedding?: Array<TextEmbeddingResult>
sparse_embedding?: Array<SparseEmbeddingResult>
}

0 comments on commit 4cb8434

Please sign in to comment.