Skip to content

Commit

Permalink
Merge pull request #27 from YerevaNN/revert-26-safe
Browse files Browse the repository at this point in the history
Revert "Safe"
  • Loading branch information
philippguevorguian authored Sep 26, 2024
2 parents 76bdcf4 + e608677 commit d584b5a
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 485 deletions.
5 changes: 0 additions & 5 deletions torchtitan/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,6 @@ def __init__(self):
default=True,
action="store_true",
help="Whether to apply loss parallel when sequence parallel is enabled",
)
self.parser.add_argument(
"--training.representation_type",
default="SMILES",
help="The representation type of the molecule for training the model.",
)
self.parser.add_argument(
"--experimental.enable_async_tensor_parallel",
Expand Down
4 changes: 1 addition & 3 deletions torchtitan/datasets/hf_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def __init__(
dataset_path: Optional[str],
data_processing_style: str,
tokenizer: Tokenizer,
representation_type: str = "SMILES",
seq_len: int = 2048,
world_size: int = 1,
rank: int = 0,
Expand Down Expand Up @@ -134,7 +133,6 @@ def __init__(
self._tokenizer = tokenizer
self.seq_len = seq_len
self.infinite = infinite
self.representation_type = representation_type
self.rank = rank
self.world_size = world_size

Expand All @@ -144,6 +142,7 @@ def __init__(
else:
self.store = None


# variables for checkpointing
self._sample_idx = 0
self._all_tokens: List[int] = []
Expand Down Expand Up @@ -256,7 +255,6 @@ def build_hf_data_loader(
seq_len: int,
world_size,
rank,
representation_type,
infinite: bool = True,
pin_memory: bool = False,
num_workers: int = 2,
Expand Down
4 changes: 2 additions & 2 deletions torchtitan/utils/dataset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def load_jsonl_line(jsonl_line):
raise ValueError(f"Error decoding JSON: {e}")


def chemlactica_style_data_processing(sample_json, rng, representation_type):
def chemlactica_style_data_processing(sample_json, rng):
try:
sample_json = json.loads(sample_json["text"])
compound = delete_empty_tags(sample_json)
sample_json = generate_formatted_string(
compound, rng, representation_type
compound, rng
)
except Exception as e:
print(e)
Expand Down
Loading

0 comments on commit d584b5a

Please sign in to comment.