FlagOpen / FlagEmbedding

Retrieval and Retrieval-augmented LLMs
MIT License
7.48k stars 538 forks source link

请问测试bge出现这个错误是为什么? #246

Open 2018211801 opened 1 year ago

2018211801 commented 1 year ago

完全按照官方指示运行的,代码也没动 Batches: 100%|██████████| 20/20 [00:37<00:00, 1.88s/it] Clustering: 0%| | 0/10 [00:37<?, ?it/s]4s/it] Error while evaluating CLSClusteringS2S: '<=' not supported between instances of 'str' and 'int' Traceback (most recent call last): File "/cognitive_comp/wangxiaochen/FlagEmbedding/C_MTEB/eval_C-MTEB.py", line 59, in evaluation.run(model, output_folder=f"zh_results/{args.model_name_or_path.split('/')[-1]}") File "/home/wangxiaochen/miniconda3/envs/bge/lib/python3.7/site-packages/mteb/evaluation/MTEB.py", line 289, in run raise e File "/home/wangxiaochen/miniconda3/envs/bge/lib/python3.7/site-packages/mteb/evaluation/MTEB.py", line 271, in run results = task.evaluate(model, split, **kwargs) File "/home/wangxiaochen/miniconda3/envs/bge/lib/python3.7/site-packages/mteb/abstasks/AbsTaskClustering.py", line 19, in evaluate metrics = evaluator(model) File "/home/wangxiaochen/miniconda3/envs/bge/lib/python3.7/site-packages/mteb/evaluation/evaluators/ClusteringEvaluator.py", line 31, in call clustering_model.fit(corpus_embeddings) File "/home/wangxiaochen/miniconda3/envs/bge/lib/python3.7/site-packages/sklearn/cluster/_kmeans.py", line 1902, in fit self._check_params(X) File "/home/wangxiaochen/miniconda3/envs/bge/lib/python3.7/site-packages/sklearn/cluster/_kmeans.py", line 1745, in _check_params super()._check_params(X) File "/home/wangxiaochen/miniconda3/envs/bge/lib/python3.7/site-packages/sklearn/cluster/_kmeans.py", line 937, in _check_params if self.n_init <= 0: TypeError: '<=' not supported between instances of 'str' and 'int'

staoxiao commented 1 year ago

可能是sklearn的版本问题,可以试试1.3.0版本