Skip to content

Commit

Permalink
[SIG] add WikiText-2&103 (#397)
Browse files Browse the repository at this point in the history
* fix conflict

* add eval_cfg
  • Loading branch information
KevinNuNu authored Sep 26, 2023
1 parent 9b21613 commit 0125466
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
4 changes: 4 additions & 0 deletions configs/datasets/wikitext/wikitext_103_raw_ppl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from mmengine.config import read_base

with read_base():
from .wikitext_103_raw_ppl_752e2a import wikitext_103_raw_datasets # noqa: F401, F403
39 changes: 39 additions & 0 deletions configs/datasets/wikitext/wikitext_103_raw_ppl_752e2a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.datasets import HFDataset


wikitext_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template={0: '{text}'}
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer), # need a new ppl inferencer
)

wikitext_eval_cfg = dict(evaluator=dict(type=AccEvaluator), )

wikitext_103_raw_datasets = []
for _split in ["validation", "test"]:

wikitext_reader_cfg = dict(
input_columns=["text"],
output_column=None,
train_split="train",
test_split=_split,
)

wikitext_103_raw_datasets.append(
dict(
abbr=f"wikitext-103-raw-{_split}",
type=HFDataset,
path="wikitext",
name="wikitext-103-raw-v1",
reader_cfg=wikitext_reader_cfg,
infer_cfg=wikitext_infer_cfg,
eval_cfg=wikitext_eval_cfg,
)
)
4 changes: 4 additions & 0 deletions configs/datasets/wikitext/wikitext_2_raw_ppl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from mmengine.config import read_base

with read_base():
from .wikitext_2_raw_ppl_752e2a import wikitext_2_raw_datasets # noqa: F401, F403
39 changes: 39 additions & 0 deletions configs/datasets/wikitext/wikitext_2_raw_ppl_752e2a.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.datasets import HFDataset


wikitext_infer_cfg = dict(
prompt_template=dict(
type=PromptTemplate,
template={0: '{text}'}
),
retriever=dict(type=ZeroRetriever),
inferencer=dict(type=GenInferencer), # need a new ppl inferencer
)

wikitext_eval_cfg = dict(evaluator=dict(type=AccEvaluator), )

wikitext_2_raw_datasets = []
for _split in ["validation", "test"]:

wikitext_reader_cfg = dict(
input_columns=["text"],
output_column=None,
train_split="train",
test_split=_split,
)

wikitext_2_raw_datasets.append(
dict(
abbr=f"wikitext-2-raw-{_split}",
type=HFDataset,
path="wikitext",
name="wikitext-2-raw-v1",
reader_cfg=wikitext_reader_cfg,
infer_cfg=wikitext_infer_cfg,
eval_cfg=wikitext_eval_cfg,
)
)

0 comments on commit 0125466

Please sign in to comment.