nvkartik commited on
Commit
ae757a6
·
1 Parent(s): b633d71
Files changed (1) hide show
  1. env.py +40 -41
env.py CHANGED
@@ -338,51 +338,50 @@ def make_env(
338
  if n_envs < 1:
339
  raise ValueError("`n_envs` must be at least 1")
340
 
341
- # Build config from cfg attributes directly (hub path) or YAML (local dev)
342
- if cfg is not None and hasattr(cfg, 'environment'):
343
- # Extract config directly from EnvConfig attributes
344
- config = {
345
- "environment": cfg.environment,
346
- "embodiment": cfg.embodiment,
347
- "object": cfg.object,
348
- "mimic": cfg.mimic,
349
- "teleop_device": cfg.teleop_device,
350
- "seed": cfg.seed,
351
- "device": cfg.device,
352
- "disable_fabric": cfg.disable_fabric,
353
- "enable_cameras": cfg.enable_cameras,
354
- "headless": cfg.headless,
355
- "enable_pinocchio": cfg.enable_pinocchio,
356
- "episode_length": cfg.episode_length,
357
- "state_dim": cfg.state_dim,
358
- "action_dim": cfg.action_dim,
359
- "camera_height": cfg.camera_height,
360
- "camera_width": cfg.camera_width,
361
- "video": cfg.video,
362
- "video_length": cfg.video_length,
363
- "video_interval": cfg.video_interval,
364
- "state_keys": cfg.state_keys,
365
- "camera_keys": cfg.camera_keys or "", # Pass empty string for no cameras
366
- "task": cfg.task,
367
- }
368
- else:
369
- # Fallback to YAML for local development
370
- yaml_path = _find_config_file(kwargs.get("config_path"))
371
- if yaml_path is not None:
372
- logging.info(f"Loading config from: {yaml_path}")
373
- with open(yaml_path) as f:
374
- config = yaml.safe_load(f) or {}
375
- else:
376
- config = {}
377
-
378
- # Apply any runtime overrides (highest priority)
379
- config.update(kwargs)
380
-
381
- if "environment" not in config:
382
  raise ValueError(
383
  "No 'environment' specified. Pass it via kwargs or create "
384
  "configs/config.yaml with environment settings."
385
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
 
387
  logging.info(
388
  f"EnvHub make_env: environment={config.get('environment')}, n_envs={n_envs}"
 
338
  if n_envs < 1:
339
  raise ValueError("`n_envs` must be at least 1")
340
 
341
+ if not hasattr(cfg, 'environment') or cfg.environment is None:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  raise ValueError(
343
  "No 'environment' specified. Pass it via kwargs or create "
344
  "configs/config.yaml with environment settings."
345
  )
346
+ # Build config from cfg attributes directly (hub path) or YAML (local dev)
347
+ # if cfg is not None and hasattr(cfg, 'environment'):
348
+ # # Extract config directly from EnvConfig attributes
349
+ config = {
350
+ "environment": cfg.environment,
351
+ "embodiment": cfg.embodiment,
352
+ "object": cfg.object,
353
+ "mimic": cfg.mimic,
354
+ "teleop_device": cfg.teleop_device,
355
+ "seed": cfg.seed,
356
+ "device": cfg.device,
357
+ "disable_fabric": cfg.disable_fabric,
358
+ "enable_cameras": cfg.enable_cameras,
359
+ "headless": cfg.headless,
360
+ "enable_pinocchio": cfg.enable_pinocchio,
361
+ "episode_length": cfg.episode_length,
362
+ "state_dim": cfg.state_dim,
363
+ "action_dim": cfg.action_dim,
364
+ "camera_height": cfg.camera_height,
365
+ "camera_width": cfg.camera_width,
366
+ "video": cfg.video,
367
+ "video_length": cfg.video_length,
368
+ "video_interval": cfg.video_interval,
369
+ "state_keys": cfg.state_keys,
370
+ "camera_keys": cfg.camera_keys or "", # Pass empty string for no cameras
371
+ "task": cfg.task,
372
+ }
373
+ # else:
374
+ # # Fallback to YAML for local development
375
+ # yaml_path = _find_config_file(kwargs.get("config_path"))
376
+ # if yaml_path is not None:
377
+ # logging.info(f"Loading config from: {yaml_path}")
378
+ # with open(yaml_path) as f:
379
+ # config = yaml.safe_load(f) or {}
380
+ # else:
381
+ # config = {}
382
+
383
+ # Apply any runtime overrides (highest priority)
384
+ # config.update(kwargs)
385
 
386
  logging.info(
387
  f"EnvHub make_env: environment={config.get('environment')}, n_envs={n_envs}"