-
Notifications
You must be signed in to change notification settings - Fork 54
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
FEA Utility function to add arbitrary files to the repo #123
Conversation
@skops-dev/maintainers Could you help me figure out why the new tests are failing? The offending code seems to stem from this fixutre: which results in the error This seems odd to me because the tests pass locally and because I'm doing basically exactly the same as, e.g., this test, which succeeds. |
- The test_inference tests had a side effect on all subsequent tests because they were cleaning up the directory which is being re-used. Now they get to have their own directory. - Wrong file name in tests for adding files
@skops-dev/maintainers The PR is ready for review now. The error mentioned above was caused by Regarding the failed codecov check: I have covered all new lines with tests, so this is a false positive. It seems that codecov thinks that my changes affect the coverage of https://app.codecov.io/gh/skops-dev/skops/compare/123/tree/skops/hub_utils/_hf_hub.py#D1L634 This is probably caused by this CI run not randomly failing when calling inference API, so it's a fluke. |
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.
first look, haven't checked the tests yet.
skops/hub_utils/_hf_hub.py
Outdated
msg = ( | ||
"First argument must be a sequence of str or Path, got " | ||
f"{type(files)} instead." | ||
) | ||
raise TypeError(msg) |
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.
even if we stick with the current signature, I think we should accept a simple string or Path here.
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
- Make files *args - Add exist_ok parameter
@adrinjalali Yes, I was thinking about making files I was also thinking about adding directories but if we want that, let's do it in another PR. |
CI does not retain logs :(
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.
Otherwise LGTM.
Whether it's okay or not to add a file that already exists. If it's | ||
okay, override the file, otherwise raise a ``FileExistsError``. | ||
|
||
Raises |
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.
nit: copy2
might also raise due to permission issues, but I'm okay not listing them here.
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.
When the copy2
function is used elsewhere, we also don't mention that error. Not sure if we should document any possible error our functions could raise or only those we explicitly raise in the function body?
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
Co-authored-by: Adrin Jalali <adrin.jalali@gmail.com>
Solves #111
This is the outcome of using
plot_hf_hub.py
with one added line:As can be seen, the script itself is now included in the upload.