[Async Inference] Add gRPC retry mechanism to Async client (#1485)

Co-authored-by: Michel Aractingi <michel.aractingi@huggingface.co>
This commit is contained in:
Eugene Mironov
2025-07-16 21:13:01 +07:00
committed by GitHub
parent dfb1571bcf
commit 816034948a
5 changed files with 50 additions and 33 deletions

View File

@@ -76,6 +76,7 @@ from lerobot.transport import (
async_inference_pb2, # type: ignore
async_inference_pb2_grpc, # type: ignore
)
from lerobot.transport.utils import grpc_channel_options
class RobotClient:
@@ -113,7 +114,9 @@ class RobotClient:
config.actions_per_chunk,
config.policy_device,
)
self.channel = grpc.insecure_channel(self.server_address)
self.channel = grpc.insecure_channel(
self.server_address, grpc_channel_options(initial_backoff=f"{config.environment_dt:.4f}s")
)
self.stub = async_inference_pb2_grpc.AsyncInferenceStub(self.channel)
self.logger.info(f"Initializing client to connect to server at {self.server_address}")