@@ -178,17 +178,24 @@ def execute_horizon(
178178
179179if __name__ == "__main__" :
180180 parser = argparse .ArgumentParser (description = "Minimal Piper Policy Test" )
181- parser .add_argument (
181+ policy_group = parser .add_mutually_exclusive_group (required = True )
182+ policy_group .add_argument (
182183 "--train-run-name" ,
183184 type = str ,
184185 default = None ,
185- help = "Name of the training run to load policy from (for cloud training). Mutually exclusive with --model-path. " ,
186+ help = "Name of the training run to load policy from (for cloud training)." ,
186187 )
187- parser .add_argument (
188+ policy_group .add_argument (
188189 "--model-path" ,
189190 type = str ,
190191 default = None ,
191- help = "Path to local model file to load policy from. Mutually exclusive with --train-run-name." ,
192+ help = "Path to local model file to load policy from." ,
193+ )
194+ policy_group .add_argument (
195+ "--remote-endpoint-name" ,
196+ type = str ,
197+ default = None ,
198+ help = "Name of remote Neuracore policy endpoint." ,
192199 )
193200 parser .add_argument (
194201 "--frequency" ,
@@ -204,12 +211,6 @@ def execute_horizon(
204211 )
205212 args = parser .parse_args ()
206213
207- # Validate that exactly one of train-run-name or model-path is provided
208- if (args .train_run_name is None ) == (args .model_path is None ):
209- parser .error (
210- "Exactly one of --train-run-name or --model-path must be provided (not both, not neither)"
211- )
212-
213214 print ("=" * 60 )
214215 print ("PIPER POLICY ROLLOUT" )
215216 print ("=" * 60 )
@@ -244,7 +245,19 @@ def execute_horizon(
244245 for data_type , names in model_output_order .items ():
245246 print (f" { data_type .name } : { names } " )
246247
247- if args .train_run_name is not None :
248+ if args .remote_endpoint_name is not None :
249+ print (
250+ f"\n 🤖 Connecting to remote policy endpoint: { args .remote_endpoint_name } ..."
251+ )
252+ try :
253+ policy = nc .policy_remote_server (args .remote_endpoint_name )
254+ except nc .EndpointError :
255+ print (
256+ f"❌ Endpoint '{ args .remote_endpoint_name } ' not available. "
257+ "Please start it from the Neuracore dashboard."
258+ )
259+ sys .exit (1 )
260+ elif args .train_run_name is not None :
248261 print (f"\n 🤖 Loading policy from training run: { args .train_run_name } ..." )
249262 policy = nc .policy (
250263 train_run_name = args .train_run_name ,
0 commit comments