Ver Fonte

Show route on client (#139)

Alexander Borzunov há 2 anos atrás
pai
commit
e1d8793f00
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      src/petals/client/routing/sequence_manager.py

+ 2 - 0
src/petals/client/routing/sequence_manager.py

@@ -117,6 +117,8 @@ class RemoteSequenceManager:
             span_sequence.append(RemoteSpanInfo(start=current_index, end=chosen_span.end, peer_id=chosen_span.peer_id))
             current_index = chosen_span.end
 
+        route_repr = " => ".join([f"{span.start}:{span.end} via …{str(span.peer_id)[-6:]}" for span in span_sequence])
+        logger.info(f"Route found: {route_repr}")
         return span_sequence
 
     def __getitem__(self, ix: Union[int, slice]) -> RemoteSequenceManager: