DeepFabric 4.6.0__py3-none-any.whl → 4.7.1__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.
deepfabric/auth.py CHANGED
@@ -60,13 +60,17 @@ def clear_tokens() -> None:
60
60
 
61
61
 
62
62
  def is_authenticated() -> bool:
63
- """Check if user is authenticated."""
64
- config = get_config()
65
- return bool(config.get("access_token") or config.get("api_key"))
63
+ """Check if user is authenticated via API key or OAuth token."""
64
+ return bool(get_auth_token())
66
65
 
67
66
 
68
67
  def get_auth_token() -> str | None:
69
- """Get authentication token (API key or access token)."""
68
+ """Get authentication token (API key from env, or stored API key/access token)."""
69
+ # Check environment variable first
70
+ env_api_key = os.getenv("DEEPFABRIC_API_KEY")
71
+ if env_api_key:
72
+ return env_api_key
73
+ # Then check stored config
70
74
  config = get_config()
71
75
  return config.get("api_key") or config.get("access_token")
72
76
 
deepfabric/dataset.py CHANGED
@@ -180,11 +180,20 @@ class Dataset:
180
180
  rng.shuffle(indices)
181
181
  return self.select(indices)
182
182
 
183
- def map(self, fn: Callable[[dict[str, Any]], dict[str, Any]]) -> "Dataset":
183
+ def map(
184
+ self,
185
+ fn: Callable[[dict[str, Any]], dict[str, Any]],
186
+ _num_proc: int | None = None,
187
+ _desc: str | None = None,
188
+ **_kwargs: Any,
189
+ ) -> "Dataset":
184
190
  """Apply function to each sample.
185
191
 
186
192
  Args:
187
193
  fn: Function that takes a sample dict and returns a new sample dict
194
+ _num_proc: Ignored (for HuggingFace Dataset compatibility)
195
+ _desc: Ignored (for HuggingFace Dataset compatibility)
196
+ **_kwargs: Additional kwargs ignored for compatibility
188
197
 
189
198
  Returns:
190
199
  New Dataset with transformed samples
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DeepFabric
3
- Version: 4.6.0
3
+ Version: 4.7.1
4
4
  Summary: Curate High Quality Datasets, Train, Evaluate and Ship
5
5
  Author-email: Luke Hinds <luke@alwaysfurther.ai>
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  deepfabric/__init__.py,sha256=DA4DT1nmF7VjQ00IA_8J_kSlqGYrK2EvP5H4XPzuKoA,1690
2
2
  deepfabric/__main__.py,sha256=Ojx6VFnAWx4wY52VehsWhW85IaEmPb8FP_sGvOk628g,113
3
- deepfabric/auth.py,sha256=NkJRthKi7vrZql34UBjKPAKC3mLhvNiEsUXoYfVjkHc,12819
3
+ deepfabric/auth.py,sha256=7UEvk84XPx7wiXj0QfhIH_MJ5BlI7wQHodwgd4LPO80,12977
4
4
  deepfabric/builders.py,sha256=XKlKsAhsed2_M_uHft-VB-n8T1ZhAbIo_7XXc2mE3Ug,11503
5
5
  deepfabric/builders_agent.py,sha256=7xaXVNzmW_vBDkxJNKR_9HveljrdljwDAFx3iu-L_-M,48468
6
6
  deepfabric/cli.py,sha256=gf7HoXlLn-8SZHHmpNWI7dwXvv_VCzu7wCQraOJkKsc,51236
@@ -8,7 +8,7 @@ deepfabric/cloud_upload.py,sha256=WYaISQY1XxorNdL7_F_FYwQUPHGJr2Bb_bohAa5xpbY,27
8
8
  deepfabric/config.py,sha256=Ze0OaCdUqFwX9bmjssf9ffU0XXwa5sJmvlyHr4FENHw,34367
9
9
  deepfabric/config_manager.py,sha256=CIOJV121tBpH_V_ljwTenvyFO31yoohPSjW0yrHCD-w,9041
10
10
  deepfabric/constants.py,sha256=MwADziDmnt0zi9t9gG65EM7AJvIQP0FSsXgGj7Yqxm8,2578
11
- deepfabric/dataset.py,sha256=prCvNiwa86fKe9VQrI10et1oYzy6h7A6Ikr5oDxBArQ,9416
11
+ deepfabric/dataset.py,sha256=bZfx35A-dt0kMflgskU9Ge-NLVesq8xNKHsrxTnNn6Q,9740
12
12
  deepfabric/dataset_manager.py,sha256=fJ6VFG05FLTpmbkLKlnVTTi7aim8q7eWI1cgOmKaP5s,20461
13
13
  deepfabric/error_codes.py,sha256=HGGWsahUTI8UG996C74X-XgNuaPX8RHo4gOidlaJql4,17630
14
14
  deepfabric/exceptions.py,sha256=pEg4YFQaDEWtBoJaSkxsJJoBBp2-6EE3M7m5H7R6i_8,1586
@@ -69,8 +69,8 @@ deepfabric/training/api_key_prompt.py,sha256=bzcdzeK6ql_8Vz0cbR2vmxxtMRNRFpzYAJx
69
69
  deepfabric/training/callback.py,sha256=vYh7nnCNf3xhbJEamWBKNXW4T7XNazXvmRqEkFyIwXI,13045
70
70
  deepfabric/training/dataset_utils.py,sha256=klx8DoawEwuMigBDP-RpMAfe7FvYxRbhj599MErxBr4,7313
71
71
  deepfabric/training/metrics_sender.py,sha256=_x0Has8ZR8ehXsdmv3nJbRDml5ioju4hZFv5ndsldpQ,10830
72
- deepfabric-4.6.0.dist-info/METADATA,sha256=AnVXX9_Yoim45cG5tVgH2v1Br2vhmhfpMqrO-Oagk24,20423
73
- deepfabric-4.6.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
74
- deepfabric-4.6.0.dist-info/entry_points.txt,sha256=zatevils13hfs8x29_vmUyivQ6rTtq7hE2RBusZw1Fo,50
75
- deepfabric-4.6.0.dist-info/licenses/LICENSE,sha256=-qRt8wmrhQ9aMf7KhmZXc2vrTETYZF-6_T1KCeUhvHY,11340
76
- deepfabric-4.6.0.dist-info/RECORD,,
72
+ deepfabric-4.7.1.dist-info/METADATA,sha256=FFTmSpKgb6pbOrYHQ9C1eCkKV6FPUAxlaH71Ij7KGwc,20423
73
+ deepfabric-4.7.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
74
+ deepfabric-4.7.1.dist-info/entry_points.txt,sha256=zatevils13hfs8x29_vmUyivQ6rTtq7hE2RBusZw1Fo,50
75
+ deepfabric-4.7.1.dist-info/licenses/LICENSE,sha256=-qRt8wmrhQ9aMf7KhmZXc2vrTETYZF-6_T1KCeUhvHY,11340
76
+ deepfabric-4.7.1.dist-info/RECORD,,