mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-12 15:19:43 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62d23b0986 | |||
| a6a2f3662a | |||
| 49444652c6 |
@@ -995,7 +995,14 @@ class PI0Policy(PreTrainedPolicy):
|
|||||||
|
|
||||||
# Initialize model without loading weights
|
# Initialize model without loading weights
|
||||||
# Check if dataset_stats were provided in kwargs
|
# Check if dataset_stats were provided in kwargs
|
||||||
model = cls(config, **kwargs)
|
if _transformers_available:
|
||||||
|
from transformers.modeling_utils import no_init_weights
|
||||||
|
|
||||||
|
with no_init_weights():
|
||||||
|
model = cls(config, **kwargs)
|
||||||
|
model.model.paligemma_with_expert.paligemma.tie_weights()
|
||||||
|
else:
|
||||||
|
model = cls(config, **kwargs)
|
||||||
|
|
||||||
# Now manually load and remap the state dict
|
# Now manually load and remap the state dict
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -967,7 +967,14 @@ class PI05Policy(PreTrainedPolicy):
|
|||||||
|
|
||||||
# Initialize model without loading weights
|
# Initialize model without loading weights
|
||||||
# Check if dataset_stats were provided in kwargs
|
# Check if dataset_stats were provided in kwargs
|
||||||
model = cls(config, **kwargs)
|
if _transformers_available:
|
||||||
|
from transformers.modeling_utils import no_init_weights
|
||||||
|
|
||||||
|
with no_init_weights():
|
||||||
|
model = cls(config, **kwargs)
|
||||||
|
model.model.paligemma_with_expert.paligemma.tie_weights()
|
||||||
|
else:
|
||||||
|
model = cls(config, **kwargs)
|
||||||
|
|
||||||
# Now manually load and remap the state dict
|
# Now manually load and remap the state dict
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -895,7 +895,14 @@ class PI0FastPolicy(PreTrainedPolicy):
|
|||||||
|
|
||||||
# Initialize model without loading weights
|
# Initialize model without loading weights
|
||||||
# Check if dataset_stats were provided in kwargs
|
# Check if dataset_stats were provided in kwargs
|
||||||
model = cls(config, **kwargs)
|
if _transformers_available:
|
||||||
|
from transformers.modeling_utils import no_init_weights
|
||||||
|
|
||||||
|
with no_init_weights():
|
||||||
|
model = cls(config, **kwargs)
|
||||||
|
model.model.paligemma_with_expert.paligemma.tie_weights()
|
||||||
|
else:
|
||||||
|
model = cls(config, **kwargs)
|
||||||
|
|
||||||
# Now manually load and remap the state dict
|
# Now manually load and remap the state dict
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user