Merge pull request #10 from StarrickLiu/main
Fix tokenizer reading and update README
This commit is contained in:
@@ -216,25 +216,15 @@ class DataCollator:
|
|||||||
if self.config.get("padding_side", "left") == "left":
|
if self.config.get("padding_side", "left") == "left":
|
||||||
self._processor_cache[processor_path].tokenizer.padding_side = "left"
|
self._processor_cache[processor_path].tokenizer.padding_side = "left"
|
||||||
|
|
||||||
if action_tokenizer_path not in self._action_tokenizer_cache:
|
if self.use_fast_tokenizer and action_tokenizer_path not in self._action_tokenizer_cache:
|
||||||
self._action_tokenizer_cache[action_tokenizer_path] = AutoProcessor.from_pretrained(action_tokenizer_path, trust_remote_code=True)
|
self._action_tokenizer_cache[action_tokenizer_path] = AutoProcessor.from_pretrained(action_tokenizer_path, trust_remote_code=True)
|
||||||
|
|
||||||
self.processor = self._processor_cache[processor_path]
|
self.processor = self._processor_cache[processor_path]
|
||||||
self.val_processor = self._processor_cache[processor_path]
|
|
||||||
self.train_action_tokenizer = self._action_tokenizer_cache[action_tokenizer_path]
|
|
||||||
self.val_action_tokenizer = self._action_tokenizer_cache[action_tokenizer_path]
|
|
||||||
|
|
||||||
new_tokens = ["<|propri|>", "<|action|>"]
|
|
||||||
|
|
||||||
new_tokens += [f"<|action_token_{i}|>" for i in range(self.train_action_tokenizer.vocab_size)]
|
|
||||||
if not self.use_fast_tokenizer:
|
if not self.use_fast_tokenizer:
|
||||||
self.train_action_tokenizer = None
|
self.train_action_tokenizer = None
|
||||||
self.val_action_tokenizer = None
|
else:
|
||||||
|
self.train_action_tokenizer = self._action_tokenizer_cache[action_tokenizer_path]
|
||||||
# Only add tokens if not already added
|
|
||||||
if "<|propri|>" not in self.processor.tokenizer.get_vocab():
|
|
||||||
num_added_tokens = self.processor.tokenizer.add_tokens(new_tokens)
|
|
||||||
self.val_processor.tokenizer.add_tokens(new_tokens)
|
|
||||||
|
|
||||||
if self.use_fast_tokenizer:
|
if self.use_fast_tokenizer:
|
||||||
self.action_mapper = {}
|
self.action_mapper = {}
|
||||||
|
|||||||
+3
-3
@@ -19,10 +19,10 @@ git clone https://huggingface.co/physical-intelligence/fast
|
|||||||
|
|
||||||
## Required Paths (Must Modify)
|
## Required Paths (Must Modify)
|
||||||
```yaml
|
```yaml
|
||||||
pretrained_wallx_path: "/path/to/wallx_model/" # Path to pretrained Qwen VL model
|
pretrained_wallx_path: "/path/to/wallx_model/" # Path to pretrained wallx model
|
||||||
use_fast_tokenizer: false # True: train FAST, False: train Flow
|
|
||||||
action_tokenizer_path: "/path/to/fast/" # Path to action tokenizer
|
|
||||||
save_path: "/path/to/workspace/" # Path to save training outputs
|
save_path: "/path/to/workspace/" # Path to save training outputs
|
||||||
|
use_fast_tokenizer: False # True: train FAST, False: train Flow
|
||||||
|
action_tokenizer_path: "/path/to/fast/" # Must set if use_fast_tokenizer is True
|
||||||
```
|
```
|
||||||
|
|
||||||
## Training Parameters (Commonly Modified)
|
## Training Parameters (Commonly Modified)
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
log_name: "robotic_training"
|
log_name: "robotic_training"
|
||||||
log_project: "vla_training"
|
log_project: "vla_training"
|
||||||
model_type: qwen2_5
|
model_type: qwen2_5
|
||||||
pretrained_wallx_path: "/path/to/wallx_model/"
|
pretrained_wallx_path: "/path/to/wallx_model/" # Must set
|
||||||
use_fast_tokenizer: false # True: train FAST, False: train Flow
|
save_path: "/path/to/workspace/" # Must set
|
||||||
action_tokenizer_path: "/path/to/fast/"
|
use_fast_tokenizer: False # True: train FAST, False: train Flow
|
||||||
save_path: "/path/to/workspace/"
|
action_tokenizer_path: "/path/to/fast/" # Must set if use_fast_tokenizer is true
|
||||||
|
|
||||||
# Torch Profile
|
# Torch Profile
|
||||||
profile: False
|
profile: False
|
||||||
|
|||||||
Reference in New Issue
Block a user