xax 0.2.18__py3-none-any.whl → 0.2.19__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
xax/__init__.py CHANGED
@@ -12,7 +12,7 @@ and running the update script:
12
12
  python -m scripts.update_api --inplace
13
13
  """
14
14
 
15
- __version__ = "0.2.18"
15
+ __version__ = "0.2.19"
16
16
 
17
17
  # This list shouldn't be modified by hand; instead, run the update script.
18
18
  __all__ = [
xax/task/base.py CHANGED
@@ -92,7 +92,11 @@ class BaseTask(Generic[Config]):
92
92
 
93
93
  @functools.cached_property
94
94
  def task_path(self) -> Path:
95
- return Path(inspect.getfile(self.__class__))
95
+ try:
96
+ return Path(inspect.getfile(self.__class__))
97
+ except OSError:
98
+ logger.warning("Could not resolve task path for %s, returning current working directory")
99
+ return Path.cwd()
96
100
 
97
101
  @functools.cached_property
98
102
  def task_module(self) -> str:
@@ -172,14 +176,18 @@ class BaseTask(Generic[Config]):
172
176
  Returns:
173
177
  The merged configs.
174
178
  """
175
- task_path = Path(inspect.getfile(cls))
179
+ try:
180
+ task_path = Path(inspect.getfile(cls))
181
+ except OSError:
182
+ logger.warning("Could not resolve task path for %s, returning current working directory", cls.__name__)
183
+ task_path = Path.cwd()
176
184
  cfg = OmegaConf.structured(cls.get_config_class())
177
185
  cfg = OmegaConf.merge(cfg, *(get_config(other_cfg, task_path) for other_cfg in cfgs))
178
186
  if use_cli:
179
187
  args = use_cli if isinstance(use_cli, list) else sys.argv[1:]
180
188
  if "-h" in args or "--help" in args:
181
- sys.stderr.write(OmegaConf.to_yaml(cfg))
182
- sys.stderr.flush()
189
+ sys.stdout.write(OmegaConf.to_yaml(cfg, sort_keys=True))
190
+ sys.stdout.flush()
183
191
  sys.exit(0)
184
192
 
185
193
  # Attempts to load any paths as configs.
@@ -43,8 +43,14 @@ class ArtifactsMixin(BaseTask[Config]):
43
43
  def run_dir(self) -> Path:
44
44
  run_dir = get_run_dir()
45
45
  if run_dir is None:
46
- task_file = inspect.getfile(self.__class__)
47
- run_dir = Path(task_file).resolve().parent
46
+ try:
47
+ task_file = inspect.getfile(self.__class__)
48
+ run_dir = Path(task_file).resolve().parent
49
+ except OSError:
50
+ logger.warning(
51
+ "Could not resolve task path for %s, returning current working directory", self.__class__.__name__
52
+ )
53
+ run_dir = Path.cwd()
48
54
  return run_dir / self.task_name
49
55
 
50
56
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xax
3
- Version: 0.2.18
3
+ Version: 0.2.19
4
4
  Summary: A library for fast Jax experimentation
5
5
  Home-page: https://github.com/kscalelabs/xax
6
6
  Author: Benjamin Bolte
@@ -1,4 +1,4 @@
1
- xax/__init__.py,sha256=ru-amUXLIpFI1cE7NfkPpff6NnuLbSh6LHbJkmvH2zM,15733
1
+ xax/__init__.py,sha256=Pv4UWs4GGvojcnBDz4hk9whnU4ZEklWXmTMaTwlSZPM,15733
2
2
  xax/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  xax/requirements-dev.txt,sha256=qkscNkFzWd1S5fump-AKH53rR65v2x5FmboFdy_kKvs,128
4
4
  xax/requirements.txt,sha256=6qY-84e-sTmlfJNrSjwONQKqzAn5h8G_oGIhnhmfSr4,302
@@ -16,7 +16,7 @@ xax/nn/metrics.py,sha256=OAkeScwhi-wTBIJ59KHUhYbZTq4V4V-LG-mKlxMJ7bY,3238
16
16
  xax/nn/parallel.py,sha256=fnTiT7MsG7eQrJvqwjIz2Ifo3P27TuxIJzmpGYSa_dQ,4608
17
17
  xax/nn/ssm.py,sha256=8dLAcQ1hBaMT-kkHvwGu_ecxJeTY32WeMYmd4T4KtxA,10745
18
18
  xax/task/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- xax/task/base.py,sha256=ymGld72zTSw50PBpX4WwqQDyJgQSagDrLh56aqvLT40,7720
19
+ xax/task/base.py,sha256=qF-ed7bFrBIRHxM7hVPLTGRYYwiLp98H0b6NWF80LTQ,8101
20
20
  xax/task/logger.py,sha256=W_BpluYvQai1lh1dDCAj-2_mWUC1buhwJncHygDffjc,41125
21
21
  xax/task/script.py,sha256=bMMIJoUtpSBvPp6-7bejTrajTXvSg0794sYLKdPIToE,972
22
22
  xax/task/task.py,sha256=UHMpnv__gqMcfbC_L-Hhk-DCnUYlFVsgbNf-v8o8B7U,1424
@@ -31,7 +31,7 @@ xax/task/loggers/state.py,sha256=0Jy0NYnY4c0qt0LvNlaTaCKOSqk5SCKln5VdyuQGnIc,140
31
31
  xax/task/loggers/stdout.py,sha256=giKSW2R83YkgRefm3BLkE7t8Pbj5Dux4AgsdJxYIbGo,6619
32
32
  xax/task/loggers/tensorboard.py,sha256=sRyBbeBeVXDTYhPZIKIapW0JEfL9hqqzhNTeIcSd374,8883
33
33
  xax/task/mixins/__init__.py,sha256=D3oU31rB9FeOr9MPLleLt5JFbftUr4sBTwgnwQdc2qA,809
34
- xax/task/mixins/artifacts.py,sha256=Ma7fwsp-SA1w6GcuBSskszj5TB83yxYJm4Ns_EnqkI4,3018
34
+ xax/task/mixins/artifacts.py,sha256=IBPAQMCGd7PQiZHfSjLakPW5j7cNuL6AsW6QkVSc02E,3277
35
35
  xax/task/mixins/checkpointing.py,sha256=w-xsx8tH8PPYRf9eoqvz-4kAdunHMvazcoZAIj6niyI,11468
36
36
  xax/task/mixins/compile.py,sha256=PG5aF3W9v_xGiImHgUJ7gmwuQQoSQWufdpl2N_mlLX0,3922
37
37
  xax/task/mixins/cpu_stats.py,sha256=rO_9a82ZdsNec61ya4FpYE-rWqPhpijRSXsOfc6caFA,9595
@@ -58,8 +58,8 @@ xax/utils/data/collate.py,sha256=Rd9vMomr_S_zCa_Hi4dO-8ntzAfVwndIUtuXFA3iNcc,706
58
58
  xax/utils/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
59
  xax/utils/types/frozen_dict.py,sha256=ebtHENhyUzSjyJTlbMaLtcckQIJ7EtgJiok_40TJZpo,4689
60
60
  xax/utils/types/hashable_array.py,sha256=l5iIcFmkYzfGeaZmcSoeFkthFASqM8xJYK3AXhZQYwc,992
61
- xax-0.2.18.dist-info/licenses/LICENSE,sha256=HCN2bImAzUOXldAZZI7JZ9PYq6OwMlDAP_PpX1HnuN0,1071
62
- xax-0.2.18.dist-info/METADATA,sha256=phU79eE74vMM79HouJP9iQgTDONJ59no3ktUl5GHF78,1880
63
- xax-0.2.18.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
64
- xax-0.2.18.dist-info/top_level.txt,sha256=g4Au_r2XhvZ-lTybviH-Fh9g0zF4DAYHYxPue1-xbs8,4
65
- xax-0.2.18.dist-info/RECORD,,
61
+ xax-0.2.19.dist-info/licenses/LICENSE,sha256=HCN2bImAzUOXldAZZI7JZ9PYq6OwMlDAP_PpX1HnuN0,1071
62
+ xax-0.2.19.dist-info/METADATA,sha256=fmZSs-aNP8Rwo9bPOnb9Fiu9UUlZ_5mxXnVl4fZkDMw,1880
63
+ xax-0.2.19.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
64
+ xax-0.2.19.dist-info/top_level.txt,sha256=g4Au_r2XhvZ-lTybviH-Fh9g0zF4DAYHYxPue1-xbs8,4
65
+ xax-0.2.19.dist-info/RECORD,,
File without changes