Skip to content

Commit

Permalink
Fix tools paths for megatron imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Anthony committed Oct 2, 2023
1 parent 42c4774 commit a76d767
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tools/ckpts/convert_hf_to_sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from transformers import GPTNeoXForCausalLM, GPTNeoXConfig

sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
)
from megatron.neox_arguments import NeoXArgs
from megatron.training import get_model, get_optimizer, get_learning_rate_scheduler
Expand Down
2 changes: 1 addition & 1 deletion tools/ckpts/convert_module_to_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
)
from megatron.tokenizer import build_tokenizer

Expand Down
2 changes: 1 addition & 1 deletion tools/ckpts/convert_sequential_to_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from typing import List

sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
)
from megatron.tokenizer import build_tokenizer

Expand Down
2 changes: 1 addition & 1 deletion tools/datasets/merge_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import argparse

sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
)

from megatron.data import indexed_dataset
Expand Down
2 changes: 1 addition & 1 deletion tools/datasets/preprocess_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import numpy as np

sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
)
import time
import tqdm
Expand Down
2 changes: 1 addition & 1 deletion tools/datasets/preprocess_data_with_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
import numpy as np

sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))
)
import time
import tqdm
Expand Down

0 comments on commit a76d767

Please sign in to comment.