Skip to content

Commit 423cdf3

Browse files
author
DvirDukhan
committed
make format
1 parent 57a26b8 commit 423cdf3

File tree

8 files changed

+30
-36
lines changed

8 files changed

+30
-36
lines changed

src/backends.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ int RAI_LoadBackend_TensorFlow(RedisModuleCtx *ctx, const char *path) {
132132
return REDISMODULE_ERR;
133133
}
134134

135-
backend.get_version = (const char*(*)(void))(unsigned long)dlsym(handle, "RAI_GetBackendVersionTF");
135+
backend.get_version =
136+
(const char *(*)(void))(unsigned long)dlsym(handle, "RAI_GetBackendVersionTF");
136137
if (backend.get_version == NULL) {
137138
dlclose(handle);
138139
RedisModule_Log(ctx, "warning",
@@ -417,7 +418,8 @@ int RAI_LoadBackend_ONNXRuntime(RedisModuleCtx *ctx, const char *path) {
417418
return REDISMODULE_ERR;
418419
}
419420

420-
backend.get_version = (const char*(*)(void))(unsigned long)dlsym(handle, "RAI_GetBackendVersionORT");
421+
backend.get_version =
422+
(const char *(*)(void))(unsigned long)dlsym(handle, "RAI_GetBackendVersionORT");
421423
if (backend.get_version == NULL) {
422424
dlclose(handle);
423425
RedisModule_Log(ctx, "warning",

src/backends.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typedef struct RAI_LoadedBackend {
7575
int (*script_run)(RAI_ScriptRunCtx *, RAI_Error *);
7676

7777
// Returns the backend version.
78-
const char* (*get_version)(void);
78+
const char *(*get_version)(void);
7979

8080
} RAI_LoadedBackend;
8181

src/backends/onnxruntime.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,4 @@ int RAI_ModelSerializeORT(RAI_Model *model, char **buffer, size_t *len, RAI_Erro
671671
return 0;
672672
}
673673

674-
const char* RAI_GetBackendVersionORT(void) {
675-
return OrtGetApiBase()->GetVersionString();
676-
}
677-
674+
const char *RAI_GetBackendVersionORT(void) { return OrtGetApiBase()->GetVersionString(); }

src/backends/onnxruntime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ int RAI_ModelRunORT(RAI_ModelRunCtx **mctxs, RAI_Error *error);
1717

1818
int RAI_ModelSerializeORT(RAI_Model *model, char **buffer, size_t *len, RAI_Error *error);
1919

20-
const char* RAI_GetBackendVersionORT(void);
20+
const char *RAI_GetBackendVersionORT(void);
2121

2222
#endif /* SRC_BACKENDS_ONNXRUNTIME_H_ */

src/backends/tensorflow.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,4 @@ int RAI_ModelSerializeTF(RAI_Model *model, char **buffer, size_t *len, RAI_Error
592592
return 0;
593593
}
594594

595-
const char* RAI_GetBackendVersionTF(void) {
596-
return TF_Version();
597-
}
595+
const char *RAI_GetBackendVersionTF(void) { return TF_Version(); }

src/backends/tensorflow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ int RAI_ModelRunTF(RAI_ModelRunCtx **mctxs, RAI_Error *error);
1919

2020
int RAI_ModelSerializeTF(RAI_Model *model, char **buffer, size_t *len, RAI_Error *error);
2121

22-
const char* RAI_GetBackendVersionTF(void);
22+
const char *RAI_GetBackendVersionTF(void);
2323

2424
#endif /* SRC_BACKENDS_TENSORFLOW_H_ */

src/redisai.c

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -805,27 +805,29 @@ int RedisAI_ScriptScan_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **arg
805805
return REDISMODULE_OK;
806806
}
807807

808-
void _RedisAI_Info(RedisModuleCtx* ctx) {
809-
RedisModuleString* rai_version = RedisModule_CreateStringPrintf(ctx, "%d.%d.%d", REDISAI_VERSION_MAJOR, REDISAI_VERSION_MINOR, REDISAI_VERSION_PATCH);
810-
RedisModuleString* llapi_version = RedisModule_CreateStringPrintf(ctx, "%d", REDISAI_LLAPI_VERSION);
811-
RedisModuleString* rdb_version = RedisModule_CreateStringPrintf(ctx, "%llu", REDISAI_ENC_VER);
808+
void _RedisAI_Info(RedisModuleCtx *ctx) {
809+
RedisModuleString *rai_version = RedisModule_CreateStringPrintf(
810+
ctx, "%d.%d.%d", REDISAI_VERSION_MAJOR, REDISAI_VERSION_MINOR, REDISAI_VERSION_PATCH);
811+
RedisModuleString *llapi_version =
812+
RedisModule_CreateStringPrintf(ctx, "%d", REDISAI_LLAPI_VERSION);
813+
RedisModuleString *rdb_version = RedisModule_CreateStringPrintf(ctx, "%llu", REDISAI_ENC_VER);
812814

813815
int reponse_len = 6;
814816

815-
if(RAI_backends.tf.get_version){
816-
reponse_len+=2;
817+
if (RAI_backends.tf.get_version) {
818+
reponse_len += 2;
817819
}
818820

819-
if(RAI_backends.torch.get_version){
820-
reponse_len+=2;
821+
if (RAI_backends.torch.get_version) {
822+
reponse_len += 2;
821823
}
822824

823-
if(RAI_backends.tflite.get_version){
824-
reponse_len+=2;
825+
if (RAI_backends.tflite.get_version) {
826+
reponse_len += 2;
825827
}
826828

827-
if(RAI_backends.onnx.get_version){
828-
reponse_len+=2;
829+
if (RAI_backends.onnx.get_version) {
830+
reponse_len += 2;
829831
}
830832

831833
RedisModule_ReplyWithArray(ctx, reponse_len);
@@ -838,21 +840,19 @@ void _RedisAI_Info(RedisModuleCtx* ctx) {
838840
RedisModule_ReplyWithSimpleString(ctx, "Low Level API Version");
839841
RedisModule_ReplyWithString(ctx, llapi_version);
840842

841-
842843
RedisModule_ReplyWithSimpleString(ctx, "RDB Encoding version");
843844
RedisModule_ReplyWithString(ctx, llapi_version);
844845

845-
if(RAI_backends.tf.get_version){
846-
RedisModule_ReplyWithSimpleString(ctx, "TensorFlow version");
847-
RedisModule_ReplyWithSimpleString(ctx, RAI_backends.tf.get_version());
846+
if (RAI_backends.tf.get_version) {
847+
RedisModule_ReplyWithSimpleString(ctx, "TensorFlow version");
848+
RedisModule_ReplyWithSimpleString(ctx, RAI_backends.tf.get_version());
848849
}
849850

850-
if(RAI_backends.onnx.get_version){
851-
RedisModule_ReplyWithSimpleString(ctx, "ONNX version");
852-
RedisModule_ReplyWithSimpleString(ctx, RAI_backends.onnx.get_version());
851+
if (RAI_backends.onnx.get_version) {
852+
RedisModule_ReplyWithSimpleString(ctx, "ONNX version");
853+
RedisModule_ReplyWithSimpleString(ctx, RAI_backends.onnx.get_version());
853854
}
854855

855-
856856
RedisModule_FreeString(ctx, rai_version);
857857
RedisModule_FreeString(ctx, llapi_version);
858858
RedisModule_FreeString(ctx, rdb_version);
@@ -865,13 +865,11 @@ int RedisAI_Info_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int
865865
if (argc > 3)
866866
return RedisModule_WrongArity(ctx);
867867

868-
869-
if(argc == 1) {
868+
if (argc == 1) {
870869
_RedisAI_Info(ctx);
871870
return REDISMODULE_OK;
872871
}
873872

874-
875873
RedisModuleString *runkey = argv[1];
876874
struct RedisAI_RunStats *rstats = NULL;
877875
if (RAI_GetRunStats(runkey, &rstats) == REDISMODULE_ERR) {

src/version.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@
1111
#define REDISAI_LLAPI_VERSION 1
1212

1313
static const long long REDISAI_ENC_VER = 1;
14-

0 commit comments

Comments
 (0)