Apply suggestions from code review

small fixes

Co-authored-by: Remi <remi.cadene@huggingface.co>
This commit is contained in:
Dana Aubakirova
2025-06-02 18:33:41 +02:00
committed by GitHub
parent 64cc94479a
commit 60389f70ca
2 changed files with 3 additions and 4 deletions

View File

@@ -133,9 +133,7 @@ class SmolVLMWithExpertModel(nn.Module):
self.expert_hidden_size = lm_expert_config.hidden_size
self.set_requires_grad()
def get_vlm_model(
self,
):
def get_vlm_model(self):
return self.vlm.model
def set_requires_grad(self):

View File

@@ -109,8 +109,9 @@ def predict_action(observation, policy, device, use_amp):
):
# Convert to pytorch format: channel first and float32 in [0,1] with batch dimension
for name in observation:
# Skip all observations that are not tensors (e.g. text)
if not isinstance(observation[name], torch.Tensor):
continue # VLA-like and multirobot policies include textual inputs in the observation
continue
if "image" in name:
observation[name] = observation[name].type(torch.float32) / 255