Updated to types of float and quantized embedding

This commit is contained in:
Prianka Liz Kariat 2023-01-30 11:42:33 +05:30
parent 8531803462
commit 8c21dc02a6
2 changed files with 6 additions and 6 deletions

View File

@ -29,13 +29,13 @@ NS_SWIFT_NAME(Embedding)
* @brief The Floating-point embedding.
* Empty if the embedder was configured to perform scalar quantization.
*/
@property(nonatomic, readonly, nullable) float *floatEmbedding;
@property(nonatomic, readonly, nullable) NSArray<NSNumber *> *floatEmbedding;
/**
* @brief The Quantized embedding.
* Empty if the embedder was not configured to perform scalar quantization.
*/
@property(nonatomic, readonly, nullable) char *quantizedEmbedding;
@property(nonatomic, readonly, nullable) NSData *quantizedEmbedding;
/** The index of the embedder head these entries refer to. This is useful for multi-head models. */
@property(nonatomic, readonly) NSInteger headIndex;
@ -55,8 +55,8 @@ NS_SWIFT_NAME(Embedding)
* @return An instance of `MPPEmbedding` initialized with the given float embedding, quantized
* embedding, head index and head name.
*/
- (instancetype)initWithFloatEmbedding:(nullable float *)floatEmbedding
quantizedEmbedding:(nullable char *)quantizedEmbedding
- (instancetype)initWithFloatEmbedding:(nullable NSArray<NSNumber *> *)floatEmbedding
quantizedEmbedding:(nullable NSData *)quantizedEmbedding
headIndex:(NSInteger)headIndex
headName:(nullable NSString *)headName NS_DESIGNATED_INITIALIZER;

View File

@ -16,8 +16,8 @@
@implementation MPPEmbedding
- (instancetype)initWithFloatEmbedding:(nullable float *)floatEmbedding
quantizedEmbedding:(nullable char *)quantizedEmbedding
- (instancetype)initWithFloatEmbedding:(nullable NSArray<NSNumber *> *)floatEmbedding
quantizedEmbedding:(nullable NSData *)quantizedEmbedding
headIndex:(NSInteger)headIndex
headName:(nullable NSString *)headName {
self = [super init];