mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-24 10:16:09 +00:00
fixup! fixup! Add tests for flow matching models with RTC
This commit is contained in:
@@ -916,8 +916,8 @@ class PI0Policy(PreTrainedPolicy):
|
|||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
# Initialize the core PI0 model
|
# Initialize the core PI0 model
|
||||||
self.model = PI0Pytorch(config, rtc_processor=self.rtc_processor)
|
|
||||||
self.init_rtc_processor()
|
self.init_rtc_processor()
|
||||||
|
self.model = PI0Pytorch(config, rtc_processor=self.rtc_processor)
|
||||||
|
|
||||||
# Enable gradient checkpointing if requested
|
# Enable gradient checkpointing if requested
|
||||||
if config.gradient_checkpointing:
|
if config.gradient_checkpointing:
|
||||||
@@ -1116,9 +1116,9 @@ class PI0Policy(PreTrainedPolicy):
|
|||||||
if self.config.rtc_config is not None:
|
if self.config.rtc_config is not None:
|
||||||
self.rtc_processor = RTCProcessor(self.config.rtc_config)
|
self.rtc_processor = RTCProcessor(self.config.rtc_config)
|
||||||
|
|
||||||
# Set rtc_processor to the model if it exists
|
model_value = getattr(self, "model", None)
|
||||||
if self.model is not None:
|
if model_value is not None:
|
||||||
self.model.rtc_processor = self.rtc_processor
|
model_value.rtc_processor = self.rtc_processor
|
||||||
|
|
||||||
def _rtc_enabled(self) -> bool:
|
def _rtc_enabled(self) -> bool:
|
||||||
return self.config.rtc_config is not None and self.config.rtc_config.enabled
|
return self.config.rtc_config is not None and self.config.rtc_config.enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user