open-compass/T-Eval

关于test_num

Closed this issue · 2 comments

您好,想请教您以下问题,非常感谢您的回答:-)

  1. test_num:'number of samples to test, -1 means all' 可以详细解释一下吗
  2. 下面第一条命令可以成功执行,第二条命令(添加--test_num 1)会报错, 为什么呢。
python test.py --model_type hf --hf_path xxx --resume --out_name instruct_xxx.json --out_dir data/work_dirs/ --dataset_path data/instruct_v1.json --eval instruct --prompt_type json
python test.py --model_type hf --hf_path xxx --resume --out_name instruct_xxx.json --out_dir data/work_dirs/ --dataset_path data/instruct_v1.json --eval instruct --prompt_type json --test_num 1

报错内容:

evaluating instruct ...
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:23<00:00,  2.92s/it]
Tested 0 samples, left 1 samples, total 2660 samples
  0%|                                                                                                                                                                                                                                                           | 1/2660 [00:17<13:04:50, 17.71s/it]
/usr/local/lib/python3.8/dist-packages/numpy/core/fromnumeric.py:3474: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/usr/local/lib/python3.8/dist-packages/numpy/core/_methods.py:189: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
defaultdict(<class 'list'>, {'json_format_metric': 0.0, 'json_args_em_metric': 0.0, 'string_format_metric': nan, 'string_args_em_metric': nan})
evaluating review ...
  1. test_num存在的目的是比如现在sample比较多 我只想跑个100条看看结果 那么就把test_num设为100, -1的话就是全部都跑~
  2. hmmm 建议你可以多infer几条 比如设置test_num=10,因为instruct的评测会同时评测str和json格式的,但是如果你只测一条那么另外一种格式的数据就没有,就会出现这种问题

知道了,感谢您的回复:-)