python_code stringlengths 0 187k | repo_name stringlengths 8 46 | file_path stringlengths 6 135 |
|---|---|---|
from catwalk.task import Task, InstanceFormat, RankClassificationInstance
from typing import Optional, Sequence, Dict, Any, Union, Iterable
import functools
import datasets
from tango.common.sequences import MappedSequence
from tango.common import det_hash
class MetaICLTask(Task):
"""A task that loads data in th... | catwalk-main | catwalk/tasks/metaicl.py |
from typing import Set, Optional, Dict, Tuple, Any, List
from catwalk.task import InstanceConversion
def t5_prompt_conversion(
*,
task_name: str,
label_field: str = "label",
label_map: Dict[int, str],
use_fields: Optional[List[str]] = None,
) -> InstanceConversion:
def convert(instance: Dict[... | catwalk-main | catwalk/tasks/t5.py |
from typing import Dict, Optional
import datasets
from torchmetrics import MeanMetric
from catwalk.task import InstanceFormat, ENTAILMENT_METRICS, QA_METRICS, Task, \
classification_metrics, BINARY_CLASSIFICATION_METRICS, mc_metrics, PERPLEXITY_METRICS
from catwalk.tasks.eleuther import EleutherTask, RaceEleuther... | catwalk-main | catwalk/tasks/__init__.py |
import collections
import functools
from typing import Dict, Any, Optional, Sequence, List
from catwalk.dependencies.promptsource.templates import (
DatasetTemplates,
TemplateCollection,
)
from catwalk.task import InstanceConversion, RankClassificationInstance, Task, InstanceFormat
_promptsource_template_coll... | catwalk-main | catwalk/tasks/promptsource.py |
import functools
from dataclasses import dataclass
import random
from typing import Optional, Sequence, Dict, Any, List, Union, Mapping, Tuple
import datasets
from tango.common.sequences import MappedSequence
from catwalk.task import Task, InstanceFormat, InstanceConversion
from catwalk.tasks.promptsource import With... | catwalk-main | catwalk/tasks/huggingface.py |
from typing import Optional, Dict, Any, List
from catwalk.task import InstanceFormat, RankClassificationInstance
from catwalk.tasks import HFDatasetsTask
class P3Task(HFDatasetsTask):
def __init__(
self,
dataset_name: str,
*,
version_override: Optional[str] = None,
):
... | catwalk-main | catwalk/tasks/p3.py |
from typing import List, Any, Dict, Tuple, Optional
from catwalk.task import InstanceFormat, RankClassificationInstance, classification_metrics
from catwalk.tasks import HFDatasetsTask
_FIELD_ORDERING = {"ade_corpus_v2": ["Sentence"], "banking_77": ["Query"], "terms_of_service": ["Sentence"],
"tai_... | catwalk-main | catwalk/tasks/raft.py |
import os
import random
from typing import Dict, Any, Optional, Union, Callable, Sequence, List, TypeVar, Tuple
from tango.common.sequences import MappedSequence
from catwalk.task import Task, InstanceFormat, RankClassificationInstance, WithAnswerOptionsMixin, \
classification_metrics
from catwalk.tasks.promptsou... | catwalk-main | catwalk/tasks/eleuther.py |
catwalk-main | catwalk/dependencies/__init__.py | |
import math
from collections.abc import Iterable
import numpy as np
import sacrebleu
import sklearn.metrics
import random
def mean(arr):
return sum(arr) / len(arr)
def pop_stddev(arr):
mu = mean(arr)
return math.sqrt(sum([(x - mu) ** 2 for x in arr]) / len(arr))
def sample_stddev(arr):
mu = mean(... | catwalk-main | catwalk/dependencies/lm_eval/metrics.py |
catwalk-main | catwalk/dependencies/lm_eval/__init__.py | |
import os
import pathlib
import re
import collections
import functools
import inspect
import sys
import pytest
from typing import List
class ExitCodeError(Exception):
pass
def sh(x):
if os.system(x):
raise ExitCodeError()
def simple_parse_args_string(args_string):
"""
Parses something like... | catwalk-main | catwalk/dependencies/lm_eval/utils.py |
import collections
import itertools
import numpy as np
import random
import catwalk.dependencies.lm_eval.metrics
import catwalk.dependencies.lm_eval.models
import catwalk.dependencies.lm_eval.tasks
import catwalk.dependencies.lm_eval.base
from catwalk.dependencies.lm_eval.utils import positional_deprecated, run_task_te... | catwalk-main | catwalk/dependencies/lm_eval/evaluator.py |
import abc
from typing import Iterable
import numpy as np
import random
import re
import os
import json
import hashlib
import datasets
from sqlitedict import SqliteDict
from tqdm import tqdm
import torch
import torch.nn.functional as F
from catwalk.dependencies.lm_eval.metrics import mean, weighted_perplexity, weighte... | catwalk-main | catwalk/dependencies/lm_eval/base.py |
"""
The LAMBADA (OpenAI) dataset: Word prediction requiring a broad discourse context∗
https://arxiv.org/pdf/1606.06031.pdf
The LAMBADA OpenAI dataset machine-translated to other languages.
LAMBADA is a dataset to evaluate the capabilities of computational models for text
understanding by means of a word prediction ta... | catwalk-main | catwalk/dependencies/lm_eval/tasks/lambada_multilingual.py |
"""
Adversarial NLI: A New Benchmark for Natural Language Understanding
https://arxiv.org/pdf/1910.14599.pdf
Adversarial NLI (ANLI) is a dataset collected via an iterative, adversarial
human-and-model-in-the-loop procedure. It consists of three rounds that progressively
increase in difficulty and complexity, and each ... | catwalk-main | catwalk/dependencies/lm_eval/tasks/anli.py |
"""
Language Models are Few-Shot Learners
https://arxiv.org/pdf/2005.14165.pdf
A small battery of 10 tests that involve asking language models a simple arithmetic
problem in natural language.
Homepage: https://github.com/openai/gpt-3/tree/master/data
"""
import inspect
import catwalk.dependencies.lm_eval.datasets.ari... | catwalk-main | catwalk/dependencies/lm_eval/tasks/arithmetic.py |
"""
The Winograd Schema Challenge
http://commonsensereasoning.org/2011/papers/Levesque.pdf
A Winograd schema is a pair of sentences that differ in only one or two words
and that contain an ambiguity that is resolved in opposite ways in the two
sentences and requires the use of world knowledge and reasoning for its res... | catwalk-main | catwalk/dependencies/lm_eval/tasks/wsc273.py |
"""
A Dataset of Information-Seeking Questions and Answers Anchored in Research Papers
https://arxiv.org/abs/2105.03011
QASPER is a dataset of 5,049 questions over 1,585 Natural Language Processing papers.
Each question is written by an NLP practitioner who read only the title and abstract
of the corresponding paper, ... | catwalk-main | catwalk/dependencies/lm_eval/tasks/qasper.py |
"""
PROST: Physical Reasoning about Objects Through Space and Time
https://arxiv.org/pdf/2106.03634.pdf
PROST, Physical Reasoning about Objects Through Space and Time, is a dataset
consisting of 18,736 multiple-choice questions made from 14 manually curated
templates, covering 10 physical reasoning concepts. All quest... | catwalk-main | catwalk/dependencies/lm_eval/tasks/prost.py |
"""
MuTual: A Dataset for Multi-Turn Dialogue Reasoning
https://www.aclweb.org/anthology/2020.acl-main.130/
MuTual is a retrieval-based dataset for multi-turn dialogue reasoning, which is
modified from Chinese high school English listening comprehension test data.
Homepage: https://github.com/Nealcly/MuTual
"""
impor... | catwalk-main | catwalk/dependencies/lm_eval/tasks/mutual.py |
"""
The LAMBADA dataset: Word prediction requiring a broad discourse context∗
https://arxiv.org/pdf/1606.06031.pdf
LAMBADA is a dataset to evaluate the capabilities of computational models for text
understanding by means of a word prediction task. LAMBADA is a collection of narrative
passages sharing the characteristi... | catwalk-main | catwalk/dependencies/lm_eval/tasks/lambada.py |
"""
SWAG: A Large-Scale Adversarial Dataset for Grounded Commonsense Inference
https://arxiv.org/pdf/1808.05326.pdf
SWAG (Situations With Adversarial Generations) is an adversarial dataset
that consists of 113k multiple choice questions about grounded situations. Each
question is a video caption from LSMDC or Activity... | catwalk-main | catwalk/dependencies/lm_eval/tasks/swag.py |
"""
"Training Verifiers to Solve Math Word Problems"
https://arxiv.org/abs/2110.14168
State-of-the-art language models can match human performance on many tasks, but
they still struggle to robustly perform multi-step mathematical reasoning. To
diagnose the failures of current models and support research, we introduce ... | catwalk-main | catwalk/dependencies/lm_eval/tasks/gsm8k.py |
"""
WinoGrande: An Adversarial Winograd Schema Challenge at Scale
https://arxiv.org/pdf/1907.10641.pdf
WinoGrande is a collection of 44k problems, inspired by Winograd Schema Challenge
(Levesque, Davis, and Morgenstern 2011), but adjusted to improve the scale and
robustness against the dataset-specific bias. Formulate... | catwalk-main | catwalk/dependencies/lm_eval/tasks/winogrande.py |
"""
MathQA: Towards Interpretable Math Word Problem Solving with Operation-Based Formalisms
https://arxiv.org/pdf/1905.13319.pdf
MathQA is a large-scale dataset of 37k English multiple-choice math word problems
covering multiple math domain categories by modeling operation programs corresponding
to word problems in th... | catwalk-main | catwalk/dependencies/lm_eval/tasks/mathqa.py |
"""
The Pile: An 800GB Dataset of Diverse Text for Language Modeling
https://arxiv.org/pdf/2101.00027.pdf
The Pile is a 825 GiB diverse, open source language modelling data set that consists
of 22 smaller, high-quality datasets combined together. To score well on Pile
BPB (bits per byte), a model must be able to under... | catwalk-main | catwalk/dependencies/lm_eval/tasks/pile.py |
"""
Measuring Massive Multitask Language Understanding
https://arxiv.org/pdf/2009.03300.pdf
The Hendryck's Test is a benchmark that measured a text model’s multitask accuracy.
The test covers 57 tasks including elementary mathematics, US history, computer
science, law, and more. To attain high accuracy on this test, m... | catwalk-main | catwalk/dependencies/lm_eval/tasks/hendrycks_test.py |
"""
A Corpus and Cloze Evaluation for Deeper Understanding of Commonsense Stories
https://arxiv.org/pdf/1604.01696.pdf
'Story Cloze Test' (2018) is a commonsense reasoning framework for evaluating story
understanding, story generation, and script learning. This test requires a system
to choose the correct ending to a ... | catwalk-main | catwalk/dependencies/lm_eval/tasks/storycloze.py |
"""
RACE: Large-scale ReAding Comprehension Dataset From Examinations
https://arxiv.org/pdf/1704.04683.pdf
RACE is a large-scale reading comprehension dataset with more than 28,000 passages
and nearly 100,000 questions. The dataset is collected from English examinations
in China, which are designed for middle school a... | catwalk-main | catwalk/dependencies/lm_eval/tasks/race.py |
"""
The Children’s Book Test (CBT) from the paper:
https://research.fb.com/wp-content/uploads/2016/11/the_goldilocks_principle_reading_children_s_books_with_explicit_memory_representations.pdf
The Children's Book Test (CBT) is test of how well language models capture
meaning in children's books. Unlike standard langua... | catwalk-main | catwalk/dependencies/lm_eval/tasks/cbt.py |
"""
Interpretable Multi-Step Reasoning with Knowledge Extraction on Complex Healthcare Question Answering
https://aclanthology.org/P19-1092.pdf
HEAD-QA is a multi-choice HEAlthcare Dataset. The questions come from exams to
access a specialized position in the Spanish healthcare system, and are challenging
even for hig... | catwalk-main | catwalk/dependencies/lm_eval/tasks/headqa.py |
from pprint import pprint
from typing import List, Union
import sacrebleu
import catwalk.dependencies.lm_eval.base
from . import superglue
from . import glue
from . import arc
from . import coqa
from . import race
from . import webqs
from . import anli
from . import wsc273
from . import winogrande
from . import quac
... | catwalk-main | catwalk/dependencies/lm_eval/tasks/__init__.py |
"""
CoQA: A Conversational Question Answering Challenge
https://arxiv.org/pdf/1808.07042.pdf
CoQA is a large-scale dataset for building Conversational Question Answering
systems. The goal of the CoQA challenge is to measure the ability of machines to
understand a text passage and answer a series of interconnected ques... | catwalk-main | catwalk/dependencies/lm_eval/tasks/coqa.py |
"""
Natural Questions: a Benchmark for Question Answering Research
https://storage.googleapis.com/pub-tools-public-publication-data/pdf/1f7b46b5378d757553d3e92ead36bda2e4254244.pdf
The Natural Questions (NQ) corpus is a question-answering dataset that contains
questions from real users and requires QA systems to read ... | catwalk-main | catwalk/dependencies/lm_eval/tasks/naturalqs.py |
"""
The LAMBADA dataset: Word prediction requiring a broad discourse context∗
https://arxiv.org/pdf/1606.06031.pdf
Cloze-style LAMBADA dataset.
LAMBADA is a dataset to evaluate the capabilities of computational models for text
understanding by means of a word prediction task. LAMBADA is a collection of narrative
passa... | catwalk-main | catwalk/dependencies/lm_eval/tasks/lambada_cloze.py |
"""
Know What You Don’t Know: Unanswerable Questions for SQuAD
https://arxiv.org/pdf/1806.03822.pdf
Stanford Question Answering Dataset (SQuAD) is a reading comprehension dataset,
consisting of questions posed by crowdworkers on a set of Wikipedia articles,
where the answer to every question is a segment of text, or s... | catwalk-main | catwalk/dependencies/lm_eval/tasks/squad.py |
"""
Aligning AI With Shared Human Values
https://arxiv.org/pdf/2008.02275.pdf
The ETHICS dataset is a benchmark that spans concepts in justice, well-being,
duties, virtues, and commonsense morality. Models predict widespread moral
judgments about diverse text scenarios. This requires connecting physical and
social wor... | catwalk-main | catwalk/dependencies/lm_eval/tasks/hendrycks_ethics.py |
"""
GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding
https://openreview.net/pdf?id=rJ4km2R5t7
The General Language Understanding Evaluation (GLUE) benchmark is a collection of
resources for training, evaluating, and analyzing natural language understanding
systems. GLUE consists of... | catwalk-main | catwalk/dependencies/lm_eval/tasks/glue.py |
"""
Crowdsourcing Multiple Choice Science Questions
https://aclanthology.org/W17-4413.pdf
The SciQ dataset contains 13,679 crowdsourced science exam questions about Physics,
Chemistry and Biology, among others. The questions are in multiple-choice format
with 4 answer options each. For the majority of the questions, a... | catwalk-main | catwalk/dependencies/lm_eval/tasks/sciq.py |
"""
TruthfulQA: Measuring How Models Mimic Human Falsehoods
https://arxiv.org/pdf/2109.07958.pdf
TruthfulQA is a benchmark to measure whether a language model is truthful in
generating answers to questions. The benchmark comprises 817 questions that
span 38 categories, including health, law, finance and politics. Ques... | catwalk-main | catwalk/dependencies/lm_eval/tasks/truthfulqa.py |
"""
HellaSwag: Can a Machine Really Finish Your Sentence?
https://arxiv.org/pdf/1905.07830.pdf
Hellaswag is a commonsense inference challenge dataset. Though its questions are
trivial for humans (>95% accuracy), state-of-the-art models struggle (<48%). This is
achieved via Adversarial Filtering (AF), a data collection... | catwalk-main | catwalk/dependencies/lm_eval/tasks/hellaswag.py |
"""
BLiMP: A Benchmark of Linguistic Minimal Pairs for English
https://arxiv.org/abs/1912.00582
BLiMP is a challenge set for evaluating what language models (LMs) know about
major grammatical phenomena in English. BLiMP consists of 67 sub-datasets, each
containing 1000 minimal pairs isolating specific contrasts in syn... | catwalk-main | catwalk/dependencies/lm_eval/tasks/blimp.py |
"""
NOTE: This file implements translation tasks using datasets from WMT conferences,
provided by sacrebleu. Traditionally they are evaluated with BLEU scores. TER
and CHRF are other options.
We defer citations and descriptions of the many translations tasks used
here to the SacreBLEU repo from which we've obtained th... | catwalk-main | catwalk/dependencies/lm_eval/tasks/translation.py |
"""
“Going on a vacation” takes longer than “Going for a walk”:
A Study of Temporal Commonsense Understanding
https://arxiv.org/pdf/1909.03065.pdf
MC-TACO is a dataset of 13k question-answer pairs that require temporal commonsense
comprehension. The dataset contains five temporal properties, (1) duration (how long
an ... | catwalk-main | catwalk/dependencies/lm_eval/tasks/mc_taco.py |
"""
SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systems
https://w4ngatang.github.io/static/papers/superglue.pdf
SuperGLUE is a benchmark styled after GLUE with a new set of more difficult language
understanding tasks.
Homepage: https://super.gluebenchmark.com/
TODO: WSC requires free-f... | catwalk-main | catwalk/dependencies/lm_eval/tasks/superglue.py |
"""
QA4MRE 2011-2013: Overview of Question Answering for Machine Reading Evaluation
https://www.cs.cmu.edu/~./hovy/papers/13CLEF-QA4MRE.pdf
The (English only) QA4MRE challenge which was run as a Lab at CLEF 2011-2013.
The main objective of this exercise is to develop a methodology for evaluating
Machine Reading system... | catwalk-main | catwalk/dependencies/lm_eval/tasks/qa4mre.py |
"""
Pointer Sentinel Mixture Models
https://arxiv.org/pdf/1609.07843.pdf
The WikiText language modeling dataset is a collection of over 100 million tokens
extracted from the set of verified Good and Featured articles on Wikipedia.
NOTE: This `Task` is based on WikiText-2.
Homepage: https://www.salesforce.com/product... | catwalk-main | catwalk/dependencies/lm_eval/tasks/wikitext.py |
"""
PubMedQA: A Dataset for Biomedical Research Question Answering
https://arxiv.org/pdf/1909.06146.pdf
PubMedQA is a novel biomedical question answering (QA) dataset collected from
PubMed abstracts. The task of PubMedQA is to answer research questions with
yes/no/maybe (e.g.: Do preoperative statins reduce atrial fib... | catwalk-main | catwalk/dependencies/lm_eval/tasks/pubmedqa.py |
"""
LogiQA: A Challenge Dataset for Machine Reading Comprehension with Logical Reasoning
https://arxiv.org/pdf/2007.08124.pdf
LogiQA is a dataset for testing human logical reasoning. It consists of 8,678 QA
instances, covering multiple types of deductive reasoning. Results show that state-
of-the-art neural models per... | catwalk-main | catwalk/dependencies/lm_eval/tasks/logiqa.py |
"""
Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answering
https://arxiv.org/pdf/1809.02789.pdf
OpenBookQA is a question-answering dataset modeled after open book exams for
assessing human understanding of a subject. It consists of 5,957 multiple-choice
elementary-level science questio... | catwalk-main | catwalk/dependencies/lm_eval/tasks/openbookqa.py |
"""
Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge
https://arxiv.org/pdf/1803.05457.pdf
The ARC dataset consists of 7,787 science exam questions drawn from a variety
of sources, including science questions provided under license by a research
partner affiliated with AI2. These are text-... | catwalk-main | catwalk/dependencies/lm_eval/tasks/arc.py |
"""
ASDiv: A Diverse Corpus for Evaluating and Developing English Math Word Problem Solvers
https://arxiv.org/abs/2106.15772
ASDiv (Academia Sinica Diverse MWP Dataset) is a diverse (in terms of both language
patterns and problem types) English math word problem (MWP) corpus for evaluating
the capability of various MW... | catwalk-main | catwalk/dependencies/lm_eval/tasks/asdiv.py |
"""
Semantic Parsing on Freebase from Question-Answer Pairs
https://cs.stanford.edu/~pliang/papers/freebase-emnlp2013.pdf
WebQuestions is a benchmark for question answering. The dataset consists of 6,642
question/answer pairs. The questions are supposed to be answerable by Freebase, a
large knowledge graph. The questi... | catwalk-main | catwalk/dependencies/lm_eval/tasks/webqs.py |
"""
Similarity of Semantic Relations
https://arxiv.org/pdf/cs/0608100.pdf
SAT (Scholastic Aptitude Test) Analogy Questions is a dataset comprising 374
multiple-choice analogy questions; 5 choices per question.
Homepage: https://aclweb.org/aclwiki/SAT_Analogy_Questions_(State_of_the_art)
"""
import inspect
import catw... | catwalk-main | catwalk/dependencies/lm_eval/tasks/sat.py |
"""
Language Models are Few-Shot Learners
https://arxiv.org/pdf/2005.14165.pdf
Unscramble is a small battery of 5 “character manipulation” tasks. Each task
involves giving the model a word distorted by some combination of scrambling,
addition, or deletion of characters, and asking it to recover the original word.
Hom... | catwalk-main | catwalk/dependencies/lm_eval/tasks/unscramble.py |
"""
QuAC: Question Answering in Context
https://arxiv.org/abs/1808.07036
Question Answering in Context (QuAC) is a dataset for modeling, understanding, and
participating in information seeking dialog. Data instances consist of an interactive
dialog between two crowd workers: (1) a student who poses a sequence of freef... | catwalk-main | catwalk/dependencies/lm_eval/tasks/quac.py |
"""
DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphs
https://aclanthology.org/attachments/N19-1246.Supplementary.pdf
DROP is a QA dataset which tests comprehensive understanding of paragraphs. In
this crowdsourced, adversarially-created, 96k question-answering benchmark, a
system mu... | catwalk-main | catwalk/dependencies/lm_eval/tasks/drop.py |
"""
TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehension
https://arxiv.org/pdf/1705.03551.pdf
TriviaQA is a reading comprehension dataset containing over 650K question-answer-evidence
triples. TriviaQA includes 95K question-answer pairs authored by trivia enthusiasts
and independent... | catwalk-main | catwalk/dependencies/lm_eval/tasks/triviaqa.py |
"""
PIQA: Reasoning about Physical Commonsense in Natural Language
https://arxiv.org/pdf/1911.11641.pdf
Physical Interaction: Question Answering (PIQA) is a physical commonsense
reasoning and a corresponding benchmark dataset. PIQA was designed to investigate
the physical knowledge of existing models. To what extent a... | catwalk-main | catwalk/dependencies/lm_eval/tasks/piqa.py |
"""
Measuring Mathematical Problem Solving With the MATH Dataset
https://arxiv.org/pdf/2103.03874.pdf
Math is a dataset of 12,500 challenging competition mathematics problems. Each
problem in Math has a full step-by-step solution which can be used to teach
models to generate answer derivations and explanations.
Homep... | catwalk-main | catwalk/dependencies/lm_eval/tasks/hendrycks_math.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/__init__.py | |
catwalk-main | catwalk/dependencies/lm_eval/datasets/quac/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/quac/quac.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/triviaqa/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/triviaqa/triviaqa.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/hendrycks_math/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/hendrycks_math/hendrycks_math.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/lambada_openai/__init__.py | |
# Copyright 2022 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/lambada_openai/lambada_openai.py |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/headqa/headqa.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/headqa/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/mutual/mutual.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/mutual/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/pile/pile.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/pile/__init__.py | |
catwalk-main | catwalk/dependencies/lm_eval/datasets/unscramble/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/unscramble/unscramble.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/logiqa/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/logiqa/logiqa.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/drop/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/drop/drop.py |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/sat_analogies/sat_analogies.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/sat_analogies/__init__.py | |
catwalk-main | catwalk/dependencies/lm_eval/datasets/coqa/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/coqa/coqa.py |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/arithmetic/arithmetic.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/arithmetic/__init__.py | |
catwalk-main | catwalk/dependencies/lm_eval/datasets/wikitext/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/wikitext/wikitext.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/asdiv/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/asdiv/asdiv.py |
catwalk-main | catwalk/dependencies/lm_eval/datasets/hendrycks_ethics/__init__.py | |
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | catwalk-main | catwalk/dependencies/lm_eval/datasets/hendrycks_ethics/hendrycks_ethics.py |
import time
import random
import pickle
import json
import glob
import os
import collections
from .janitor import Janitor, word_ngrams
from .archiver import ZStdTextReader
# Was used for testing the evaluator decoupled from the full logic below
def get_train_overlap_stub(docs, ngrams_path, ngrams_n_size):
simula... | catwalk-main | catwalk/dependencies/lm_eval/decontamination/decontaminate.py |
import os
import zstandard
import json
import jsonlines
import io
import datetime
import mmap
import tqdm
from pathlib import Path
def json_serial(obj):
"""JSON serializer for objects not serializable by default json code"""
if isinstance(obj, (datetime.datetime,)):
return obj.isoformat()
raise T... | catwalk-main | catwalk/dependencies/lm_eval/decontamination/archiver.py |
catwalk-main | catwalk/dependencies/lm_eval/decontamination/__init__.py | |
import re
import string
import timeit
import pickle
import traceback
from pprint import pprint
# This is a cpp module. Compile janitor_util.cpp with:
# c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) janitor_util.cpp -o janitor_util$(python3-config --extension-suffix) -undefined dynamic_lookup... | catwalk-main | catwalk/dependencies/lm_eval/decontamination/janitor.py |
import os
import numpy as np
import transformers
from catwalk.dependencies.lm_eval.base import BaseLM
from catwalk.dependencies.lm_eval import utils
from tqdm import tqdm
import time
def get_result(response, ctxlen):
"""Process results from OpenAI API response.
:param response: dict
OpenAI API Respon... | catwalk-main | catwalk/dependencies/lm_eval/models/gpt3.py |
import transformers
import torch
from catwalk.dependencies.lm_eval.base import BaseLM
class HFLM(BaseLM):
def __init__(
self,
device="cuda",
pretrained="gpt2",
revision="main",
subfolder=None,
tokenizer=None,
batch_size=1,
):
super().__init__()
... | catwalk-main | catwalk/dependencies/lm_eval/models/gpt2.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.