Skip to content

Commit

Permalink
lint and minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmeda14960 committed Oct 9, 2024
1 parent 2f625d3 commit cf2c9e5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions scripts/launch_gpt2_small_fast_supervised_tpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Launches the "gpt_small_fast" model on a TPU node

python infra/launch.py --foreground --tpu_name $(whoami)-levanter-itest-32 --zone us-central2-b --tpu_type v4-32 --preemptible -- \
python -m levanter.main.train_lm \
--config_path config/gpt2_small_fast_supervised.yaml \
--trainer.checkpointer.base_path gs://levanter-checkpoints/gpt-itest/ --trainer.checkpointer.save_interval 30m $*
2 changes: 1 addition & 1 deletion scripts/launch_gpt2_small_fast_tpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

python infra/launch.py --foreground --tpu_name $(whoami)-levanter-itest-32 --zone us-central2-b --tpu_type v4-32 --preemptible -- \
python -m levanter.main.train_lm \
--config_path config/gpt2_small_fast_supervised.yaml \
--config_path config/gpt2_small_fast.yaml \
--trainer.checkpointer.base_path gs://levanter-checkpoints/gpt-itest/ --trainer.checkpointer.save_interval 30m $*
2 changes: 0 additions & 2 deletions src/levanter/data/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ def num_gpus(self) -> int:
return 0




def concatenate_and_group_texts(
encoding: BatchEncoding,
seq_len: int,
Expand Down
4 changes: 3 additions & 1 deletion src/levanter/utils/fsspec_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fsspec
import braceexpand


def exists(url, **kwargs) -> bool:
"""Check if a file exists on a remote filesystem."""
fs, path = fsspec.core.url_to_fs(url, **kwargs)
Expand All @@ -12,6 +13,7 @@ def mkdirs(path):
fs, path = fsspec.core.url_to_fs(path)
fs.makedirs(path, exist_ok=True)


def fsspec_expand_glob(url):
expanded_urls = braceexpand.braceexpand(url)
for expanded_url in expanded_urls:
Expand All @@ -25,4 +27,4 @@ def fsspec_expand_glob(url):
else:
yield from [f"{protocol}://{path}" for path in globbed]
else:
yield expanded_url
yield expanded_url

0 comments on commit cf2c9e5

Please sign in to comment.