-
Notifications
You must be signed in to change notification settings - Fork 52
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
Use patch file to use requests to download dataset for 24.12 #723
Closed
Closed
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
117d98e
FIX apply patch to use requests to download dataset
dantegd 836a299
FIX style fixes
dantegd 45eebf0
FIX fixes from pr review and other small things
dantegd ca91968
FIX wrong package name
dantegd d3ad5f2
Fix patch file path
raydouglass c8e0af0
FIX install patch with apt-get
dantegd fcddc40
FIX use __path__ instead of __file__ because cuvs-bench has an empty …
dantegd 841e4a7
FIX run apt-get update to get ubuntu 24.04 to fetch patch
dantegd f6b14ae
Clean up after apt installs
raydouglass File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
diff --git a/python/cuvs_bench/cuvs_bench/get_dataset/__main__.py b/python/cuvs_bench/cuvs_bench/get_dataset/__main__.py | ||
index a6b154ef..b023fcbd 100644 | ||
--- a/python/cuvs_bench/cuvs_bench/get_dataset/__main__.py | ||
+++ b/python/cuvs_bench/cuvs_bench/get_dataset/__main__.py | ||
@@ -17,7 +17,7 @@ import argparse | ||
import os | ||
import subprocess | ||
import sys | ||
-from urllib.request import urlretrieve | ||
+import requests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the container have |
||
|
||
|
||
def get_dataset_path(name, ann_bench_data_path): | ||
@@ -29,7 +29,12 @@ def get_dataset_path(name, ann_bench_data_path): | ||
def download_dataset(url, path): | ||
if not os.path.exists(path): | ||
print(f"downloading {url} -> {path}...") | ||
- urlretrieve(url, path) | ||
+ with requests.get(url, stream=True) as r: | ||
+ r.raise_for_status() | ||
+ with open(path, "wb") as f: | ||
+ for chunk in r.iter_content(chunk_size=8192): | ||
+ if chunk: | ||
+ f.write(chunk) | ||
|
||
|
||
def convert_hdf5_to_fbin(path, normalize): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If going this route, this patch file needs to be copied into the container, like here: https://github.com/rapidsai/docker/blob/branch-25.02/cuvs-bench/gpu/Dockerfile#L55