Skip to content

Commit 1b6746b

Browse files
committed
fix: Properly handle unlinking temp file during fine-tuning download
1 parent f59d672 commit 1b6746b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/together/lib/resources/files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def download(
193193
stream=True,
194194
)
195195
except APIStatusError as e:
196-
os.remove(lock_path)
196+
lock_path.unlink(missing_ok=True)
197197
raise APIStatusError(
198198
"Error downloading file",
199199
response=e.response,
@@ -282,7 +282,7 @@ def download(
282282
# Moves temp file to output file path
283283
chmod_and_replace(Path(temp_file.name), file_path)
284284

285-
os.remove(lock_path)
285+
lock_path.unlink(missing_ok=True)
286286

287287
return str(file_path.resolve()), file_size
288288

0 commit comments

Comments
 (0)