"vscode:/vscode.git/clone" did not exist on "50b9c40ac77d1471d9c188408eb2f870df7bb975"
Unverified Commit 3850e21a authored by Baber Abbasi's avatar Baber Abbasi Committed by GitHub
Browse files

`samples` is newline delimited (#1930)



* `samples` is newline delimited

* updated git and pre-commit

* appease pre-commit

* nit

* Revert back for now

* Revert for now

---------
Co-authored-by: default avatarLintang Sutawika <lintang@eleuther.ai>
parent 793469e0
...@@ -20,13 +20,13 @@ jobs: ...@@ -20,13 +20,13 @@ jobs:
with: with:
fetch-depth: 2 # OR "2" -> To retrieve the preceding commit. fetch-depth: 2 # OR "2" -> To retrieve the preceding commit.
# Uses the tj-actions/changed-files@v37 action to check for changes. # Uses the tj-actions/changed-files action to check for changes.
# Outputs provided here: https://github.com/tj-actions/changed-files#outputs # Outputs provided here: https://github.com/tj-actions/changed-files#outputs
# The `files_yaml` input optionally takes a yaml string to specify filters, # The `files_yaml` input optionally takes a yaml string to specify filters,
# and prepends the filter name to the standard output names. # and prepends the filter name to the standard output names.
- name: Check task folders - name: Check task folders
id: changed-tasks id: changed-tasks
uses: tj-actions/changed-files@v37.1.2 uses: tj-actions/changed-files@v44.5.2
with: with:
# tasks checks the tasks folder and api checks the api folder for changes # tasks checks the tasks folder and api checks the api folder for changes
files_yaml: | files_yaml: |
......
...@@ -32,7 +32,7 @@ jobs: ...@@ -32,7 +32,7 @@ jobs:
env: env:
SKIP: "no-commit-to-branch,mypy" SKIP: "no-commit-to-branch,mypy"
uses: pre-commit/action@v3.0.0 uses: pre-commit/action@v3.0.1
# # mypy turned off for now # # mypy turned off for now
# - name: Lint with mypy # - name: Lint with mypy
# run: mypy . --ignore-missing-imports --check-untyped-defs --explicit-package-bases --warn-unreachable # run: mypy . --ignore-missing-imports --check-untyped-defs --explicit-package-bases --warn-unreachable
......
...@@ -29,8 +29,7 @@ repos: ...@@ -29,8 +29,7 @@ repos:
- id: mixed-line-ending - id: mixed-line-ending
args: [--fix=lf] args: [--fix=lf]
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version. rev: v0.4.8
rev: v0.2.2
hooks: hooks:
# Run the linter. # Run the linter.
- id: ruff - id: ruff
...@@ -39,7 +38,7 @@ repos: ...@@ -39,7 +38,7 @@ repos:
# Run the formatter. # Run the formatter.
- id: ruff-format - id: ruff-format
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.6 rev: v2.3.0
hooks: hooks:
- id: codespell - id: codespell
exclude: > exclude: >
...@@ -47,9 +46,9 @@ repos: ...@@ -47,9 +46,9 @@ repos:
.*\.json|ignore.txt|lm_eval/tasks/.*|.*yaml|.*\.ipynb .*\.json|ignore.txt|lm_eval/tasks/.*|.*yaml|.*\.ipynb
)$ )$
args: [--check-filenames, --check-hidden, --ignore-words=ignore.txt] args: [--check-filenames, --check-hidden, --ignore-words=ignore.txt]
- repo: https://github.com/pre-commit/mirrors-mypy # - repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1 # rev: v1.5.1
hooks: # hooks:
- id: mypy # - id: mypy
additional_dependencies: [".[sentencepiece,multilingual,promptsource,gptq]", "types-PyYAML", "types-requests"] # additional_dependencies: [".[sentencepiece,multilingual,promptsource,gptq]", "types-PyYAML", "types-requests"]
exclude: ^tests/.*$ # exclude: ^tests/.*$
...@@ -67,9 +67,9 @@ class TaskConfig(dict): ...@@ -67,9 +67,9 @@ class TaskConfig(dict):
training_split: Optional[str] = None training_split: Optional[str] = None
validation_split: Optional[str] = None validation_split: Optional[str] = None
test_split: Optional[str] = None test_split: Optional[str] = None
fewshot_split: Optional[ fewshot_split: Optional[str] = (
str None # TODO: assert that this not None if num_fewshot > 0. (?) assert if this is same split as one evaling (?)
] = None # TODO: assert that this not None if num_fewshot > 0. (?) assert if this is same split as one evaling (?) )
# formatting / prompting options. # formatting / prompting options.
# see docs/advanced_task_guide.md for more info # see docs/advanced_task_guide.md for more info
process_docs: Optional[Callable] = None process_docs: Optional[Callable] = None
...@@ -92,9 +92,9 @@ class TaskConfig(dict): ...@@ -92,9 +92,9 @@ class TaskConfig(dict):
filter_list: Optional[Union[str, list]] = None filter_list: Optional[Union[str, list]] = None
should_decontaminate: bool = False should_decontaminate: bool = False
doc_to_decontamination_query: Optional[str] = None doc_to_decontamination_query: Optional[str] = None
metadata: Optional[ metadata: Optional[dict] = (
dict None # by default, not used in the code. allows for users to pass arbitrary info to tasks
] = None # by default, not used in the code. allows for users to pass arbitrary info to tasks )
def __post_init__(self) -> None: def __post_init__(self) -> None:
if self.generation_kwargs is not None: if self.generation_kwargs is not None:
...@@ -229,9 +229,9 @@ class Task(abc.ABC): ...@@ -229,9 +229,9 @@ class Task(abc.ABC):
self._config: TaskConfig = TaskConfig({**config}) if config else TaskConfig() self._config: TaskConfig = TaskConfig({**config}) if config else TaskConfig()
self._filters = [build_filter_ensemble("none", [["take_first", None]])] self._filters = [build_filter_ensemble("none", [["take_first", None]])]
self.fewshot_rnd: Optional[ self.fewshot_rnd: Optional[random.Random] = (
random.Random None # purposely induce errors in case of improper usage
] = None # purposely induce errors in case of improper usage )
def download( def download(
self, self,
......
...@@ -4,7 +4,6 @@ from lm_eval.api.registry import register_filter ...@@ -4,7 +4,6 @@ from lm_eval.api.registry import register_filter
@register_filter("decontaminate") @register_filter("decontaminate")
class DecontaminationFilter(Filter): class DecontaminationFilter(Filter):
""" """
A filter which evaluates A filter which evaluates
""" """
......
...@@ -259,7 +259,7 @@ class EvaluationTracker: ...@@ -259,7 +259,7 @@ class EvaluationTracker:
path.mkdir(parents=True, exist_ok=True) path.mkdir(parents=True, exist_ok=True)
file_results_samples = path.joinpath( file_results_samples = path.joinpath(
f"samples_{task_name}_{self.date_id}.json" f"samples_{task_name}_{self.date_id}.jsonl"
) )
for sample in samples: for sample in samples:
......
""" TextSynth API """TextSynth API
Implementation provided by Fabrice Bellard: Implementation provided by Fabrice Bellard:
https://github.com/EleutherAI/lm-evaluation-harness/issues/295 https://github.com/EleutherAI/lm-evaluation-harness/issues/295
...@@ -11,6 +11,7 @@ Example usage: ...@@ -11,6 +11,7 @@ Example usage:
Homepage: https://textsynth.com/index.html Homepage: https://textsynth.com/index.html
""" """
import logging import logging
import os import os
......
""" """
Take in a YAML, and output all other splits with this YAML Take in a YAML, and output all other splits with this YAML
""" """
import argparse import argparse
import os import os
......
""" """
Take in a YAML, and output all other splits with this YAML Take in a YAML, and output all other splits with this YAML
""" """
import argparse import argparse
import os import os
import re import re
......
""" """
Take in a YAML, and output all other splits with this YAML Take in a YAML, and output all other splits with this YAML
""" """
import argparse import argparse
import os import os
......
...@@ -8,6 +8,7 @@ Requires the installation of ...@@ -8,6 +8,7 @@ Requires the installation of
`pip install "bigbench @ https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz"` `pip install "bigbench @ https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz"`
and is included so that the bigbench dependency can be avoided. and is included so that the bigbench dependency can be avoided.
""" """
import bigbench.api.util as bb_utils import bigbench.api.util as bb_utils
import datasets import datasets
from tqdm import tqdm from tqdm import tqdm
......
""" """
Take in a YAML, and output all other splits with this YAML Take in a YAML, and output all other splits with this YAML
""" """
import argparse import argparse
import os import os
......
""" """
Take in a YAML, and output all other splits with this YAML Take in a YAML, and output all other splits with this YAML
""" """
import argparse import argparse
import os import os
......
""" """
Take in a YAML, and output all other splits with this YAML Take in a YAML, and output all other splits with this YAML
""" """
import argparse import argparse
import os import os
......
"""
"""
import re import re
from typing import List from typing import List
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
"""Library of instructions.""" """Library of instructions."""
import collections import collections
import json import json
import logging import logging
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# limitations under the License. # limitations under the License.
"""Registry of all instructions.""" """Registry of all instructions."""
from lm_eval.tasks.ifeval import instructions from lm_eval.tasks.ifeval import instructions
......
""" """
Take in a YAML, and output all "other" splits with this YAML Take in a YAML, and output all "other" splits with this YAML
""" """
import argparse import argparse
import logging import logging
import os import os
......
"""
"""
import re import re
from typing import List from typing import List
......
...@@ -13,6 +13,7 @@ also determine when no answer is supported by the paragraph and abstain from ans ...@@ -13,6 +13,7 @@ also determine when no answer is supported by the paragraph and abstain from ans
Homepage: https://rajpurkar.github.io/SQuAD-explorer/ Homepage: https://rajpurkar.github.io/SQuAD-explorer/
""" """
from functools import partial from functools import partial
from math import exp from math import exp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment