Closed alexott closed 6 months ago
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) File ~/notebooks/ch10/../ltr/judgments.py:40, in judgments_open(path, mode) 39 try: ---> 40 f=open(path, mode) 41 if mode[0] == 'r': FileNotFoundError: [Errno 2] No such file or directory: 'data/ai_pow_search_judgments.txt' During handling of the above exception, another exception occurred: UnboundLocalError Traceback (most recent call last) Cell In[10], line 8 4 from ltr import download 6 ftr_logger=FeatureLogger(client, index='tmdb', feature_set='movies') ----> 8 with judgments_open('data/ai_pow_search_judgments.txt') as judgment_list: 9 for qid, query_judgments in groupby(judgment_list, key=lambda j: j.qid): 10 ftr_logger.log_for_qid(judgments=query_judgments, 11 qid=qid, 12 keywords=judgment_list.keywords(qid)) File /opt/conda/lib/python3.10/contextlib.py:135, in _GeneratorContextManager.__enter__(self) 133 del self.args, self.kwds, self.func 134 try: --> 135 return next(self.gen) 136 except StopIteration: 137 raise RuntimeError("generator didn't yield") from None File ~/notebooks/ch10/../ltr/judgments.py:48, in judgments_open(path, mode) 46 writer.flush() 47 finally: ---> 48 f.close() UnboundLocalError: local variable 'f' referenced before assignment
Tagging @softwaredoug
Fixed in the latest versions...