Skip to content

Commit be96df5

Browse files
Merge branch 'open-compass:main' into more_case_into_pr
2 parents b510df4 + 4df8be6 commit be96df5

5 files changed

Lines changed: 1125 additions & 0 deletions

File tree

.github/workflows/pr-stage-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- name: Install opencompass dependencies
5353
run: |
5454
python -m pip install -r requirements.txt
55+
python -m pip install huggingface-hub==1.15.0
5556
- name: Build and install
5657
run: python -m pip install -e .
5758
- name: Prepare dataset
@@ -105,6 +106,7 @@ jobs:
105106
- name: Install opencompass dependencies
106107
run: |
107108
python -m pip install -r requirements.txt
109+
python -m pip install huggingface-hub==1.15.0
108110
- name: Build and install
109111
run: python -m pip install -e .
110112
- name: Prepare dataset
@@ -134,6 +136,7 @@ jobs:
134136
- name: Install opencompass dependencies
135137
run: |
136138
pip install -r requirements.txt
139+
pip install huggingface-hub==1.15.0
137140
- name: Build and install
138141
run: pip install -e .
139142
- name: Prepare dataset

opencompass/cli/main.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from opencompass.utils import (HeartBeatManager, LarkReporter, get_logger,
1717
pretty_print_config, read_from_station,
1818
save_to_station)
19+
from opencompass.utils.repeat_analysis import analyze_repeat_predictions
1920
from opencompass.utils.run import (fill_eval_cfg, fill_infer_cfg,
2021
get_config_from_arg)
2122

@@ -151,6 +152,10 @@ def parse_args():
151152
help='dump the length of model responses',
152153
action='store_true',
153154
default=False)
155+
parser.add_argument('--analysis-repeat',
156+
help='Analyze repeated predictions in viz stage.',
157+
action='store_true',
158+
default=False)
154159
parser.add_argument(
155160
'--dump-extract-rate',
156161
help='Whether to dump the evaluation details, including the '
@@ -500,6 +505,13 @@ def main():
500505
summarizer = build_from_cfg(summarizer_cfg)
501506
summarizer.summarize(time_str=cfg_time_str)
502507

508+
if args.analysis_repeat:
509+
output_path = analyze_repeat_predictions(
510+
cfg,
511+
time_str=cfg_time_str,
512+
show_progress=True,
513+
print_summary=True)
514+
logger.info(f'write repeat analysis to {osp.abspath(output_path)}')
503515

504516

505517
if __name__ == '__main__':

opencompass/datasets/SciReasoner/bio_instruction.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,21 @@ def compute_AUC_for_Modification_task(task_name, task_entries, model_name):
10121012
over_len += 1
10131013
else:
10141014
miss_len += 1
1015+
if not entry['model_output'].strip():
1016+
y_true.append(convert_to_binary_vector(entry['label'].split(',')))
1017+
y_pred.append(convert_to_binary_vector([]))
1018+
task_processed_data.append({
1019+
'input':
1020+
entry['input'],
1021+
'label':
1022+
entry['label'],
1023+
'processed_model_ouput': [],
1024+
'original_model_output':
1025+
entry['model_output']
1026+
})
1027+
print('label', entry['label'])
1028+
print('predication', [])
1029+
continue
10151030
predicted_modifications = extract_modifications(entry['model_output'])
10161031
# print(predicted_modifications)
10171032
true_modifications = entry['label'].split(',')

0 commit comments

Comments
 (0)