-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix conflict * add eval_cfg
- Loading branch information
Showing
4 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) | ||
) |