Skip to content
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

[ML] Adding text embedding byte representation #2410

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
}
Loading