PrithivirajDamodaran / FlashRank

Lite & Super-fast re-ranking for your search & retrieval pipelines. Supports SoTA Listwise and Pairwise reranking based on LLMs and cross-encoders and more. Created by Prithivi Da, open for PRs & Collaborations.
Apache License 2.0
441 stars 37 forks source link

ResourceWarning: Enable tracemalloc to get the object allocation traceback #25

Open sudhanshu746 opened 1 week ago

sudhanshu746 commented 1 week ago

tokens_map = json.load(open(str(self.model_dir / "special_tokens_map.json") You have opened special token file, used it, but then forgot to close the file.

when Python closes it for you when it notices that the file object is dead, but this only occurs after some unknown time has elapsed. Thus in recent versions, Python also prints a ResourceWarning when it does that.