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

Add dataset support for .tsv files #637

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

manifoldhiker
Copy link
Contributor

This PR contains:

  • New features
  • Changes to dev-tools e.g. CI config / github tooling
  • Docs
  • Bug fixes
  • Code refactor

What is the current behavior? (You can also link to an open issue here)

  1. It is not possible to load .tsv files properly
  2. It is not possible to load .csv and .tsv files without a header

MGSM dataset uses tab-separated file format without a header.
See simple-evals/mgsm_eval.py

This functionality would help add MGSM to inspect_eval (see UKGovernmentBEIS/inspect_evals#3 )

What is the new behavior?

  1. New parameter fieldnames is added to csv_dataset. By default it is None, which preserves backward compatibility. This parameter is passed directly into csv.
  2. Docstring is updated.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No breaking changes.

Other information:

This is how I currently use csv_dataset:

  mgsm_dataset = csv_dataset(
      tsv_file_path, fieldnames=["input", "target"], dialect="excel-tab"
  )

I am not very familiar with the codebase. Tests are passing, but not 100% that this will not break anything.

Copy link
Collaborator

@jjallaire-aisi jjallaire-aisi left a comment

Choose a reason for hiding this comment

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

Thank you!!!

@jjallaire-aisi jjallaire-aisi merged commit 2c4c8ce into UKGovernmentBEIS:main Oct 4, 2024
9 checks passed
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.

2 participants