@@ -66,6 +66,7 @@ def pretty_print(self) -> None:
6666
6767class ModelConfig (BaseModel ):
6868 model_name : str
69+ model_class : str | None = None
6970 model_kwargs : dict [str , Any ]
7071
7172
@@ -90,7 +91,7 @@ def extract_triple_backticks(text: str) -> str:
9091class BigQuestions :
9192 def __init__ (self , config : BigQuestionsConfig ):
9293 self .config = config
93- self .model = get_model (config .model .model_name , config = {"model_kwargs" : config .model .model_kwargs })
94+ self .model = get_model (config .model .model_name , config = {"model_kwargs" : config .model .model_kwargs , "model_class" : config . model . model_class })
9495
9596 @property
9697 def data_id (self ) -> str :
@@ -145,20 +146,24 @@ def _get_messages(self, instance: Instance) -> list[dict[str, Any]]:
145146
146147 def _should_skip (self , target_path : Path , instance : Instance ) -> bool :
147148 if not target_path .exists ():
149+ logger .debug (f"Not skipping: { target_path } does not exist" )
148150 return False
149151 content = target_path .read_text ()
150152 if not content .strip ():
153+ logger .debug (f"Not skipping: { target_path } is empty" )
151154 return False
152155 data = json .loads (content )
153156 if self .data_id not in data :
157+ logger .debug (f"Not skipping: { self .data_id } not in { target_path } " )
154158 return False
155- if instance .instance_id in data [self .data_id ]:
156- return True
157- return False
159+ if instance .instance_id not in data [self .data_id ]:
160+ logger .debug (f"Not skipping: { instance .instance_id } not in { target_path } under key { self .data_id } " )
161+ return False
162+ return True
158163
159164 def _save_response (self , target_path : Path , response_data : dict [str , Any ], instance : Instance ) -> None :
160165 # atomic write with file lock in case other analyses are also writing
161- with FileLock (target_path ):
166+ with FileLock (target_path . with_suffix ( ".lock" ) ):
162167 # read again if changed in the meantime
163168 data = {}
164169 if target_path .exists ():
0 commit comments