@@ -178,7 +178,7 @@ int RAI_GetTensorFromKeyspace(RedisModuleCtx *ctx, RedisModuleString *keyName,
178
178
179
179
/* Return REDISMODULE_ERR if there was an error getting the Tensor.
180
180
* Return REDISMODULE_OK if the tensor value is present at the localContextDict. */
181
- int RAI_GetTensorFromLocalContext (RedisModuleCtx * ctx ,
181
+ int RAI_getTensorFromLocalContext (RedisModuleCtx * ctx ,
182
182
AI_dict * localContextDict ,
183
183
const char * localContextKey ,
184
184
RAI_Tensor * * tensor ) {
@@ -825,22 +825,6 @@ int RAI_parseTensorGetArgs(RedisModuleCtx *ctx, RedisModuleString **argv, int ar
825
825
}
826
826
RedisModule_ReplyWithDouble (ctx , val );
827
827
}
828
- argpos ++ ;
829
- break ;
830
- } else {
831
- long long dimension = 1 ;
832
- const int retval = RedisModule_StringToLongLong (argv [argpos ],& dimension );
833
- if (retval != REDISMODULE_OK || dimension <= 0 ) {
834
- RedisModule_Free (dims );
835
- RedisModule_CloseKey (key );
836
- return RedisModule_ReplyWithError (ctx ,
837
- "ERR invalid or negative value found in tensor shape" );
838
- }
839
-
840
- ndims ++ ;
841
- dims = RedisModule_Realloc (dims ,ndims * sizeof (long long ));
842
- dims [ndims - 1 ]= dimension ;
843
- len *= dimension ;
844
828
}
845
829
else {
846
830
long long val ;
@@ -919,13 +903,6 @@ int RedisAI_ModelSet_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
919
903
if (strlen (devicestr ) > 10 ) {
920
904
return RedisModule_ReplyWithError (ctx , "ERR Invalid DEVICE" );
921
905
}
922
- else if (datafmt == REDISAI_DATA_VALUES ) {
923
- long long ndims = RAI_TensorNumDims (t );
924
- long long len = 1 ;
925
- long long i ;
926
- for (i = 0 ; i < ndims ; i ++ ) {
927
- len *= RAI_TensorDim (t , i );
928
- }
929
906
930
907
const char * tag = "" ;
931
908
if (AC_AdvanceIfMatch (& ac , "TAG" )) {
@@ -951,10 +928,6 @@ int RedisAI_ModelSet_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
951
928
return RedisModule_ReplyWithError (ctx , "ERR Invalid argument for MINBATCHSIZE" );
952
929
}
953
930
}
954
- RedisModule_CloseKey (key );
955
-
956
- return REDISMODULE_OK ;
957
- }
958
931
959
932
960
933
if (AC_IsAtEnd (& ac )) {
@@ -1080,11 +1053,8 @@ int RedisAI_ModelSet_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
1080
1053
1081
1054
RedisModule_ReplicateVerbatim (ctx );
1082
1055
1083
- size_t ninputs = inac .argc ;
1084
- const char * inputs [ninputs ];
1085
- for (size_t i = 0 ; i < ninputs ; i ++ ) {
1086
- AC_GetString (& inac , inputs + i , NULL , 0 );
1087
- }
1056
+ return REDISMODULE_OK ;
1057
+ }
1088
1058
1089
1059
/**
1090
1060
* AI.MODELGET model_key [META | BLOB]
@@ -1107,8 +1077,6 @@ int RedisAI_ModelGet_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
1107
1077
else if (!strcasecmp (optstr , "BLOB" )) {
1108
1078
blob = 1 ;
1109
1079
}
1110
- RAI_ClearError (& err );
1111
- model = RAI_ModelCreate (backend , devicestr , tag , opts , ninputs , inputs , noutputs , outputs , modeldef , modellen , & err );
1112
1080
}
1113
1081
1114
1082
RAI_Error err = {0 };
@@ -1259,7 +1227,7 @@ int RedisAI_Parse_ModelRun_RedisCommand(RedisModuleCtx *ctx,
1259
1227
}
1260
1228
RedisModule_CloseKey (tensorKey );
1261
1229
} else {
1262
- const int get_result = RAI_GetTensorFromLocalContext (
1230
+ const int get_result = RAI_getTensorFromLocalContext (
1263
1231
ctx , * localContextDict , arg_string , & inputTensor );
1264
1232
if (get_result == REDISMODULE_ERR ) {
1265
1233
return -1 ;
@@ -1970,7 +1938,7 @@ int RedisAI_DagRun_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
1970
1938
const char * key_string = RedisModule_StringPtrLen (argv [argpos + 1 ], NULL );
1971
1939
RAI_Tensor * t = NULL ;
1972
1940
const int get_result =
1973
- RAI_GetTensorFromLocalContext (ctx , dagTensorsContext , key_string , & t );
1941
+ RAI_getTensorFromLocalContext (ctx , dagTensorsContext , key_string , & t );
1974
1942
if (get_result == REDISMODULE_OK ) {
1975
1943
const int parse_result =
1976
1944
RAI_parseTensorGetArgs (ctx , & argv [argpos ], argc - argpos , t );
0 commit comments