Skip to content

Commit

Permalink
Update f.original_filename to os.path.basename(f.original_filename) t…
Browse files Browse the repository at this point in the history
…o get the original file name when it is the full path to the image
  • Loading branch information
Khadijeh Alibabaei committed Sep 12, 2024
1 parent c3ad616 commit c83142d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def predict(**args):
with tempfile.TemporaryDirectory() as tmpdir:
for f in [args["files"]]:
shutil.copy(
f.filename, tmpdir + "/" + f.original_filename
f.filename, tmpdir + "/" + os.path.basename(f.original_filename)
)

args["files"] = [
Expand Down

0 comments on commit c83142d

Please sign in to comment.