diff --git a/python/cog/files.py b/python/cog/files.py index ce0bd47152..7303fb9c7e 100644 --- a/python/cog/files.py +++ b/python/cog/files.py @@ -14,7 +14,7 @@ def upload_file(fh: io.IOBase, output_file_prefix: Optional[str] = None) -> str: if output_file_prefix is not None: name = getattr(fh, "name", "output") - url = output_file_prefix + os.path.basename(name) + url = output_file_prefix.rstrip("/") + "/" + os.path.basename(name) resp = requests.put(url, files={"file": fh}, timeout=5) resp.raise_for_status() return url