mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-26 11:16:00 +00:00
fix: move rabc.py to rewards/sarm/ and update import paths
This commit is contained in:
@@ -149,7 +149,7 @@ def _make_rabc_weighter(
|
|||||||
dataset_repo_id: HuggingFace repo ID (for auto-detecting progress_path).
|
dataset_repo_id: HuggingFace repo ID (for auto-detecting progress_path).
|
||||||
"""
|
"""
|
||||||
# Import here to avoid circular imports and keep RABC code in SARM module
|
# Import here to avoid circular imports and keep RABC code in SARM module
|
||||||
from lerobot.policies.sarm.rabc import RABCWeights
|
from lerobot.rewards.sarm.rabc import RABCWeights
|
||||||
|
|
||||||
# Extract chunk_size from policy config
|
# Extract chunk_size from policy config
|
||||||
chunk_size = getattr(policy.config, "chunk_size", None)
|
chunk_size = getattr(policy.config, "chunk_size", None)
|
||||||
@@ -171,7 +171,7 @@ def _make_rabc_weighter(
|
|||||||
"RABC sample weighting requires 'progress_path' to be set, "
|
"RABC sample weighting requires 'progress_path' to be set, "
|
||||||
"or dataset_root/dataset_repo_id for auto-detection. "
|
"or dataset_root/dataset_repo_id for auto-detection. "
|
||||||
"Generate progress values using: "
|
"Generate progress values using: "
|
||||||
"python -m lerobot.policies.sarm.compute_rabc_weights --help"
|
"python -m lerobot.rewards.sarm.compute_rabc_weights --help"
|
||||||
)
|
)
|
||||||
|
|
||||||
return RABCWeights(
|
return RABCWeights(
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ def test_factory_rabc_auto_detects_from_dataset_root(sample_progress_parquet):
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert weighter is not None
|
assert weighter is not None
|
||||||
from lerobot.policies.sarm.rabc import RABCWeights
|
from lerobot.rewards.sarm.rabc import RABCWeights
|
||||||
|
|
||||||
assert isinstance(weighter, RABCWeights)
|
assert isinstance(weighter, RABCWeights)
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ def test_factory_rabc_auto_detects_from_repo_id():
|
|||||||
|
|
||||||
def test_rabc_weights_is_sample_weighter(sample_progress_parquet):
|
def test_rabc_weights_is_sample_weighter(sample_progress_parquet):
|
||||||
"""Test that RABCWeights inherits from SampleWeighter."""
|
"""Test that RABCWeights inherits from SampleWeighter."""
|
||||||
from lerobot.policies.sarm.rabc import RABCWeights
|
from lerobot.rewards.sarm.rabc import RABCWeights
|
||||||
|
|
||||||
weighter = RABCWeights(
|
weighter = RABCWeights(
|
||||||
progress_path=sample_progress_parquet,
|
progress_path=sample_progress_parquet,
|
||||||
@@ -318,7 +318,7 @@ def test_rabc_weights_is_sample_weighter(sample_progress_parquet):
|
|||||||
|
|
||||||
def test_rabc_compute_batch_weights(sample_progress_parquet):
|
def test_rabc_compute_batch_weights(sample_progress_parquet):
|
||||||
"""Test RABCWeights.compute_batch_weights returns correct structure."""
|
"""Test RABCWeights.compute_batch_weights returns correct structure."""
|
||||||
from lerobot.policies.sarm.rabc import RABCWeights
|
from lerobot.rewards.sarm.rabc import RABCWeights
|
||||||
|
|
||||||
weighter = RABCWeights(
|
weighter = RABCWeights(
|
||||||
progress_path=sample_progress_parquet,
|
progress_path=sample_progress_parquet,
|
||||||
@@ -338,7 +338,7 @@ def test_rabc_compute_batch_weights(sample_progress_parquet):
|
|||||||
|
|
||||||
def test_rabc_get_stats(sample_progress_parquet):
|
def test_rabc_get_stats(sample_progress_parquet):
|
||||||
"""Test RABCWeights.get_stats returns expected structure."""
|
"""Test RABCWeights.get_stats returns expected structure."""
|
||||||
from lerobot.policies.sarm.rabc import RABCWeights
|
from lerobot.rewards.sarm.rabc import RABCWeights
|
||||||
|
|
||||||
weighter = RABCWeights(
|
weighter = RABCWeights(
|
||||||
progress_path=sample_progress_parquet,
|
progress_path=sample_progress_parquet,
|
||||||
@@ -360,7 +360,7 @@ def test_rabc_get_stats(sample_progress_parquet):
|
|||||||
|
|
||||||
def test_factory_creates_rabc_weighter(sample_progress_parquet):
|
def test_factory_creates_rabc_weighter(sample_progress_parquet):
|
||||||
"""Test factory creates RABCWeights with valid config."""
|
"""Test factory creates RABCWeights with valid config."""
|
||||||
from lerobot.policies.sarm.rabc import RABCWeights
|
from lerobot.rewards.sarm.rabc import RABCWeights
|
||||||
|
|
||||||
config = SampleWeightingConfig(
|
config = SampleWeightingConfig(
|
||||||
type="rabc",
|
type="rabc",
|
||||||
@@ -381,7 +381,7 @@ def test_factory_creates_rabc_weighter(sample_progress_parquet):
|
|||||||
|
|
||||||
def test_rabc_weights_normalization(sample_progress_parquet):
|
def test_rabc_weights_normalization(sample_progress_parquet):
|
||||||
"""Test that RABCWeights normalizes weights to sum to batch_size."""
|
"""Test that RABCWeights normalizes weights to sum to batch_size."""
|
||||||
from lerobot.policies.sarm.rabc import RABCWeights
|
from lerobot.rewards.sarm.rabc import RABCWeights
|
||||||
|
|
||||||
weighter = RABCWeights(
|
weighter = RABCWeights(
|
||||||
progress_path=sample_progress_parquet,
|
progress_path=sample_progress_parquet,
|
||||||
|
|||||||
Reference in New Issue
Block a user