parthsarthi03 / raptor

The official implementation of RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval
https://arxiv.org/abs/2401.18059
MIT License
688 stars 98 forks source link

change the dim to a safe n_components #16

Closed LLLeoLi closed 3 months ago

LLLeoLi commented 3 months ago

fix the bug about issue#15

parthsarthi03 commented 3 months ago

LGTM, thanks for the bug fix!

ATP-BME commented 2 months ago

File /data/cj_group/shuyu/raptor/raptor/cluster_utils.py:179, in RAPTOR_Clustering.perform_clustering(nodes, embedding_model_name, max_length_in_cluster, tokenizer, reduction_dimension, threshold, verbose) 174 if verbose: 175 logging.info( 176 f"reclustering cluster with {len(cluster_nodes)} nodes" 177 ) 178 node_clusters.extend( --> 179 RAPTOR_Clustering.perform_clustering( 180 cluster_nodes, embedding_model_name, max_length_in_cluster 181 ) 182 ) ... 1796 or isinstance(self.n_epochs, tuple) 1797 or isinstance(self.n_epochs, np.ndarray) 1798 ):

ValueError: n_components must be greater than 0

it seems that dim<=0 and caused this error