From 1beb2894f8e893affac4cd35495b80c6381d8cd4 Mon Sep 17 00:00:00 2001 From: yltony12 Date: Wed, 25 Dec 2024 22:16:52 -0500 Subject: [PATCH] fix the process_time issue. remove the 'finally' as it will overwrite the internal correct return, with process_time as None. Signed-off-by: yltony12 --- coding/validator/forward.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/coding/validator/forward.py b/coding/validator/forward.py index 965351f..952b2e8 100644 --- a/coding/validator/forward.py +++ b/coding/validator/forward.py @@ -64,9 +64,14 @@ async def process_response(uid: int, async_generator: Awaitable): if chunk is not None: synapse = chunk # last object yielded is the synapse itself with completion filled + # bt.logging.debug(f"process_time: synapse.dendrite.process_time}") # Assuming chunk holds the last value yielded which should be a synapse if isinstance(synapse, StreamCodeSynapse): return synapse + else: + raise ValueError( + f"Expected a StreamCodeSynapse but received {type(synapse)}" + ) bt.logging.debug( f"Synapse is not StreamCodeSynapse. Miner uid {uid} completion set to '' " @@ -83,10 +88,6 @@ async def process_response(uid: int, async_generator: Awaitable): ) return failed_synapse - finally: - return StreamCodeSynapse( - completion=buffer - ) async def handle_response(responses: Dict[int, Awaitable]) -> List[StreamResult]: