Skip to content

Commit c83142d

Browse files
author
Khadijeh Alibabaei
committed
Update f.original_filename to os.path.basename(f.original_filename) to get the original file name when it is the full path to the image
1 parent c3ad616 commit c83142d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def predict(**args):
116116
with tempfile.TemporaryDirectory() as tmpdir:
117117
for f in [args["files"]]:
118118
shutil.copy(
119-
f.filename, tmpdir + "/" + f.original_filename
119+
f.filename, tmpdir + "/" + os.path.basename(f.original_filename)
120120
)
121121

122122
args["files"] = [

0 commit comments

Comments
 (0)