MCPcopy Create free account
hub / github.com/RedisGears/RedisGears / _createModelRunOp

Function _createModelRunOp

plugins/python/redisgears_python.c:2363–2379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2361}
2362
2363static RAI_DAGRunOp *_createModelRunOp(const char *modelNameStr, RAI_Error *err) {
2364
2365 RedisGears_LockHanlderAcquire(staticCtx);
2366 RedisModuleString* keyRedisStr = RedisModule_CreateString(staticCtx, modelNameStr, strlen(modelNameStr));
2367 RAI_Model *model;
2368 if(RedisAI_GetModelFromKeyspace(staticCtx, keyRedisStr, &model, REDISMODULE_READ, err) != REDISMODULE_OK) {
2369 RedisModule_FreeString(staticCtx, keyRedisStr);
2370 RedisGears_LockHanlderRelease(staticCtx);
2371 PyErr_SetString(GearsError, RedisAI_GetError(err));
2372 return NULL;
2373 }
2374
2375 RedisModule_FreeString(staticCtx, keyRedisStr);
2376 RAI_DAGRunOp *modelRunOp = RedisAI_DAGCreateModelRunOp(model);
2377 RedisGears_LockHanlderRelease(staticCtx);
2378 return modelRunOp;
2379}
2380
2381static PyObject* DAGAddModelRun(PyObject *self, PyObject *args, PyObject *kargs) {
2382 verifyRedisAILoaded();

Callers 1

DAGAddModelRunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected