Skip to content

Commit 2da9964

Browse files
committed
Add check if save path is not None
1 parent 8fdb9bc commit 2da9964

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

autogen/retrieve_utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ def get_file_from_url(url: str, save_path: str = None):
256256
if save_path is None:
257257
os.makedirs("/tmp/chromadb", exist_ok=True)
258258
save_path = os.path.join("/tmp/chromadb", os.path.basename(url))
259+
else:
260+
os.makedirs(os.path.dirname(save_path), exist_ok=True)
259261
with requests.get(url, stream=True) as r:
260262
r.raise_for_status()
261263
with open(save_path, "wb") as f:

0 commit comments

Comments
 (0)