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

Support Hugging Face data split code example #176

Merged
merged 26 commits into from
Jan 27, 2025
Merged

Conversation

ehsantn
Copy link
Collaborator

@ehsantn ehsantn commented Jan 24, 2025

Changes included in this PR

Adds support for HuggingFace data split code examples that select things like "train" from a constant dictionary.

See here as an example (click on "use this dataset" then "pandas"): https://huggingface.co/datasets/openai/gsm8k

import pandas as pd

splits = {'train': 'main/train-00000-of-00001.parquet', 'test': 'main/test-00000-of-00001.parquet'}
df = pd.read_parquet("hf://datasets/openai/gsm8k/" + splits["train"])

A bunch of error checking tests needed to be updated since the tested patterns now work.

Testing strategy

Added a unit test.

User facing changes

The above code pattern works now.

Checklist

  • Pipelines passed before requesting review. To run CI you must include [run CI] in your commit message.
  • I am familiar with the Contributing Guide
  • I have installed + ran pre-commit hooks.

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (main@0bda3f0). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #176   +/-   ##
=======================================
  Coverage        ?   77.77%           
=======================================
  Files           ?      169           
  Lines           ?    61952           
  Branches        ?     8671           
=======================================
  Hits            ?    48185           
  Misses          ?    11668           
  Partials        ?     2099           

Base automatically changed from ehsan/hf_read_csv to main January 24, 2025 18:10
Copy link
Contributor

@scott-routledge2 scott-routledge2 left a comment

Choose a reason for hiding this comment

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

LGTM

@ehsantn ehsantn merged commit b585341 into main Jan 27, 2025
22 checks passed
@ehsantn ehsantn deleted the ehsan/hf_const_dict branch January 27, 2025 15:29
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.

3 participants