mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
parent
9b21613d17
commit
012546666b
4
configs/datasets/wikitext/wikitext_103_raw_ppl.py
Normal file
4
configs/datasets/wikitext/wikitext_103_raw_ppl.py
Normal file
@ -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
configs/datasets/wikitext/wikitext_103_raw_ppl_752e2a.py
Normal file
39
configs/datasets/wikitext/wikitext_103_raw_ppl_752e2a.py
Normal file
@ -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
configs/datasets/wikitext/wikitext_2_raw_ppl.py
Normal file
4
configs/datasets/wikitext/wikitext_2_raw_ppl.py
Normal file
@ -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
configs/datasets/wikitext/wikitext_2_raw_ppl_752e2a.py
Normal file
39
configs/datasets/wikitext/wikitext_2_raw_ppl_752e2a.py
Normal file
@ -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,
|
||||
)
|
||||
)
|
Loading…
Reference in New Issue
Block a user