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

Fix HuggingFace uploads and downloads #316

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

anth-volk
Copy link
Contributor

Fixes #314
Fixes #315

@nikhilwoodruff If these changes don't match with how you're envisioning this working with the policyengine.py package, please feel free to let me know. I obviously don't want to step on your toes, I just ran into a couple issues when attempting to use the HuggingFace code live and believe this would fix these issues. Also, these changes assume that the standard HuggingFace URL looks something like this example for the ECPS:

hf://policyengine/policyengine-us-data/enhanced_cps_2024.h5

If that's not actually how they look, then these changes may not function correctly.

To avoid ambiguity and the need for -core to treat one type of URL as preferential over another, this PR merges the url and huggingface_url attributes of Dataset instances into one url. It removes any code attempting to prioritize one over the other, then makes changes to the download_from_huggingface method to better match the relevant underlying method.

Copy link
Contributor

@nikhilwoodruff nikhilwoodruff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge on addressing review comments- thanks Anthony!

policyengine_core/data/dataset.py Outdated Show resolved Hide resolved
policyengine_core/data/dataset.py Outdated Show resolved Hide resolved
@anth-volk anth-volk changed the title Fix HuggingFace uploads and downloads Fix Hugging Face uploads and downloads Dec 2, 2024
@anth-volk anth-volk changed the title Fix Hugging Face uploads and downloads Fix HuggingFace uploads and downloads Dec 2, 2024
@anth-volk anth-volk merged commit 155b01a into PolicyEngine:master Dec 2, 2024
3 checks passed
@anth-volk anth-volk deleted the fix/refactor-dataset branch December 2, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge huggingface_url and url params into one Possible bug in HuggingFace download code from Dataset class
2 participants