Skip to content

Commit 23bad99

Browse files
author
Khadijeh Alibabaei
committed
Update __init__.py
1 parent f1893b3 commit 23bad99

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

api/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ def predict(**args):
114114
"augment for segmentation has not been supported yet"
115115
)
116116
with tempfile.TemporaryDirectory() as tmpdir:
117-
for f in [args["input"]]:
117+
for f in [args["files"]]:
118118
shutil.copy(
119119
f.filename, tmpdir + "/" + f.original_filename
120120
)
121121

122-
args["input"] = [
122+
args["files"] = [
123123
os.path.join(tmpdir, t) for t in os.listdir(tmpdir)
124124
]
125125
result = aimodel.predict(**args)
@@ -267,11 +267,11 @@ def main():
267267
else:
268268
logger.debug("Calling method with args: %s", args)
269269
del vars(args)["method"]
270-
if hasattr(args, "input"):
270+
if hasattr(args, "files"):
271271
file_extension = os.path.splitext(args.input)[1]
272-
args.input = UploadedFile(
272+
args.files = UploadedFile(
273273
"input",
274-
args.input,
274+
args.files,
275275
"application/octet-stream",
276276
f"input{file_extension}",
277277
)

0 commit comments

Comments
 (0)