Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract base name from URLs correctly #836

Draft
wants to merge 3 commits into
base: mainline
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/marqo/s2_inference/processing/custom_clip_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from urllib.parse import urlparse

import regex as re
from typing import Union, List, Optional
import ftfy
Expand Down Expand Up @@ -145,7 +147,7 @@ def download_pretrained_from_url(
os.makedirs(cache_dir, exist_ok=True)

if cache_file_name is None:
filename = os.path.basename(url)
filename = os.path.basename(urlparse(url).path)
else:
filename = cache_file_name

Expand Down
Loading