diff --git a/src/synthia/validator/text_validator.py b/src/synthia/validator/text_validator.py index 9e1fd22..579a18d 100644 --- a/src/synthia/validator/text_validator.py +++ b/src/synthia/validator/text_validator.py @@ -274,7 +274,7 @@ async def _get_miner_prediction( val_info: ValidationDataset, miner_info: tuple[list[str], Ss58Address], ) -> tuple[str | None, ValidationDataset]: - miner_answer = None + miner_answer: str | None | list[str] = None try: connection, miner_key = miner_info @@ -291,7 +291,13 @@ async def _get_miner_prediction( "generate", miner_key, {"prompt": question}, timeout=self.call_timeout ) miner_answer = response.get("answer") + if isinstance(miner_answer, list): + if len(miner_answer) == 0: + miner_answer = None + else: + miner_answer = miner_answer[0] except Exception as e: + miner_answer = None log(f"Miner {module_ip}:{module_port} failed to generate an answer: {e}") # This is needed, so truly nothing can get propagated through the call stack