Skip to content

Commit d457162

Browse files
author
Sherin Thomas
authored
Merge pull request #35 from RedisAI/chunking_fix
[HOTFIX] Fix chunking in modelset
2 parents 6a8f618 + e7d3eae commit d457162

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

redisai/command_builder.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ def modelset(self, name: AnyStr, backend: str, device: str, data: ByteString,
3333
chunk_size = 500 * 1024 * 1024
3434
data_chunks = [data[i:i + chunk_size] for i in range(0, len(data), chunk_size)]
3535
# TODO: need a test case for this
36-
final_args = [*args, 'BLOB', data_chunks.pop(0)]
37-
if len(data_chunks) > 0:
38-
for d in data_chunks:
39-
final_args += [*args, d]
40-
return final_args
36+
args += ['BLOB', *data_chunks]
37+
return args
4138

4239
def modelget(self, name: AnyStr, meta_only=False) -> Sequence:
4340
args = ['AI.MODELGET', name, 'META']

0 commit comments

Comments
 (0)