facat commited on
Commit
29eceda
1 Parent(s): 32ae64f
Files changed (1) hide show
  1. tasks.py +21 -34
tasks.py CHANGED
@@ -781,42 +781,29 @@ class BBH:
781
  def suite(
782
  cls,
783
  ):
784
- finer_categories = (
785
- pd.Series(
786
- cls.bbh_free_form_sets + cls.bbh_multiple_choice_sets
787
- ) # noqa # type: ignore
788
- .explode()
789
- .reset_index()
790
- .set_index(0)
791
- .groupby(0)
792
- .agg(list)["index"]
793
- .to_dict()
794
- )
795
- suite = defaultdict(list)
796
- categories = list(finer_categories.keys())
797
- for cate in categories:
798
- if cate in cls.bbh_multiple_choice_sets:
799
- suite[cate].append(
800
- Task(
801
- ("lukaemon/bbh", cate),
802
- metric_name=("sustech/tlem", "bbh_mcq"),
803
- input_column=cls.input_column,
804
- label_column=cls.label_column,
805
- prompt=partial(cls.prompt_bbh, category=cate),
806
- few_shot=0,
807
- )
808
  )
809
- else:
810
- suite[cate].append(
811
- Task(
812
- ("lukaemon/bbh", cate),
813
- metric_name=("sustech/tlem", "bbh_freefrom"),
814
- input_column=cls.input_column,
815
- label_column=cls.label_column,
816
- prompt=partial(cls.prompt_bbh, category=cate),
817
- few_shot=0,
818
- )
819
  )
 
820
 
821
  return suite
822
 
 
781
  def suite(
782
  cls,
783
  ):
784
+ suite = []
785
+ for cate in cls.bbh_multiple_choice_sets:
786
+ suite.append(
787
+ Task(
788
+ ("lukaemon/bbh", cate),
789
+ metric_name=("sustech/tlem", "bbh_mcq"),
790
+ input_column=cls.input_column,
791
+ label_column=cls.label_column,
792
+ prompt=partial(cls.prompt_bbh, category=cate),
793
+ few_shot=0,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
794
  )
795
+ )
796
+ for cate in cls.bbh_free_form_sets:
797
+ suite.append(
798
+ Task(
799
+ ("lukaemon/bbh", cate),
800
+ metric_name=("sustech/tlem", "bbh_freefrom"),
801
+ input_column=cls.input_column,
802
+ label_column=cls.label_column,
803
+ prompt=partial(cls.prompt_bbh, category=cate),
804
+ few_shot=0,
805
  )
806
+ )
807
 
808
  return suite
809