DeepFabric 4.7.0__py3-none-any.whl → 4.8.0__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/dataset.py +10 -1
- deepfabric/schemas.py +25 -4
- deepfabric/training/__init__.py +1 -1
- deepfabric/training/api_key_prompt.py +5 -5
- deepfabric/training/callback.py +2 -2
- deepfabric/training/metrics_sender.py +1 -1
- {deepfabric-4.7.0.dist-info → deepfabric-4.8.0.dist-info}/METADATA +2 -2
- {deepfabric-4.7.0.dist-info → deepfabric-4.8.0.dist-info}/RECORD +11 -11
- {deepfabric-4.7.0.dist-info → deepfabric-4.8.0.dist-info}/WHEEL +0 -0
- {deepfabric-4.7.0.dist-info → deepfabric-4.8.0.dist-info}/entry_points.txt +0 -0
- {deepfabric-4.7.0.dist-info → deepfabric-4.8.0.dist-info}/licenses/LICENSE +0 -0
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(
|
|
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
|
deepfabric/schemas.py
CHANGED
|
@@ -4,11 +4,12 @@ import logging
|
|
|
4
4
|
import re
|
|
5
5
|
import secrets
|
|
6
6
|
import string
|
|
7
|
+
import warnings
|
|
7
8
|
|
|
8
9
|
from decimal import ROUND_HALF_UP, Decimal
|
|
9
10
|
from typing import Annotated, Any, Literal
|
|
10
11
|
|
|
11
|
-
from pydantic import BaseModel, BeforeValidator, Field, field_validator
|
|
12
|
+
from pydantic import BaseModel, BeforeValidator, Field, field_validator, model_validator
|
|
12
13
|
|
|
13
14
|
logger = logging.getLogger(__name__)
|
|
14
15
|
|
|
@@ -796,15 +797,35 @@ class ReasoningTrace(BaseModel):
|
|
|
796
797
|
class ToolContext(BaseModel):
|
|
797
798
|
"""Tool execution history - present when tools are used.
|
|
798
799
|
|
|
799
|
-
Note: available_tools has been
|
|
800
|
-
|
|
801
|
-
|
|
800
|
+
Note: available_tools has been deprecated in favor of the top-level 'tools'
|
|
801
|
+
field in Conversation. Use 'tools' for the OpenAI-format tool definitions
|
|
802
|
+
needed by chat templates. The field is kept here for backward compatibility
|
|
803
|
+
with existing datasets.
|
|
802
804
|
"""
|
|
803
805
|
|
|
804
806
|
executions: list[ToolExecution] = Field(
|
|
805
807
|
default_factory=list,
|
|
806
808
|
description="Tool executions performed during the conversation (may be empty if agent answered without tools)",
|
|
807
809
|
)
|
|
810
|
+
# Deprecated: kept for backward compatibility with existing datasets
|
|
811
|
+
available_tools: list[dict[str, Any]] | None = Field(
|
|
812
|
+
default=None,
|
|
813
|
+
description="Deprecated: Use top-level 'tools' field instead. Kept for backward compatibility.",
|
|
814
|
+
)
|
|
815
|
+
|
|
816
|
+
@model_validator(mode="after")
|
|
817
|
+
def warn_on_deprecated_available_tools(self) -> "ToolContext":
|
|
818
|
+
"""Warn if the deprecated `available_tools` field is used."""
|
|
819
|
+
if self.available_tools is not None:
|
|
820
|
+
warnings.warn(
|
|
821
|
+
(
|
|
822
|
+
"'tool_context.available_tools' is deprecated and will be removed in a future version. "
|
|
823
|
+
"Use the top-level 'tools' field in Conversation instead."
|
|
824
|
+
),
|
|
825
|
+
DeprecationWarning,
|
|
826
|
+
stacklevel=2,
|
|
827
|
+
)
|
|
828
|
+
return self
|
|
808
829
|
|
|
809
830
|
class Config:
|
|
810
831
|
extra = "forbid"
|
deepfabric/training/__init__.py
CHANGED
|
@@ -28,7 +28,7 @@ Usage:
|
|
|
28
28
|
|
|
29
29
|
Environment Variables:
|
|
30
30
|
DEEPFABRIC_API_KEY: API key for authentication
|
|
31
|
-
DEEPFABRIC_API_URL: SaaS backend URL (default: https://api.deepfabric.
|
|
31
|
+
DEEPFABRIC_API_URL: SaaS backend URL (default: https://api.deepfabric.cloud)
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
34
|
from __future__ import annotations
|
|
@@ -127,9 +127,9 @@ def _show_notebook_prompt() -> str | None:
|
|
|
127
127
|
</div>
|
|
128
128
|
<p style="margin: 0; font-size: 14px; opacity: 0.9;">
|
|
129
129
|
Enter your API key to automatically log training metrics.<br>
|
|
130
|
-
|
|
130
|
+
You can create a key from your profile page: <a href="https://deepfabric.cloud/profile"
|
|
131
131
|
target="_blank" style="color: #fff; text-decoration: underline;">
|
|
132
|
-
|
|
132
|
+
deepfabric.cloud/profile</a>
|
|
133
133
|
</p>
|
|
134
134
|
</div>
|
|
135
135
|
"""
|
|
@@ -182,8 +182,8 @@ def _show_colab_prompt() -> str | None:
|
|
|
182
182
|
</div>
|
|
183
183
|
<p style="margin: 0; font-size: 14px; opacity: 0.9;">
|
|
184
184
|
Enter your API key below to log training metrics.<br>
|
|
185
|
-
|
|
186
|
-
target="_blank" style="color: #fff;">
|
|
185
|
+
You can create a key from your profile page: <a href="https://deepfabric.cloud/profile"
|
|
186
|
+
target="_blank" style="color: #fff;">deepfabric.cloud/profile</a><br>
|
|
187
187
|
<em>Press Enter without typing to skip.</em>
|
|
188
188
|
</p>
|
|
189
189
|
</div>
|
|
@@ -211,7 +211,7 @@ def _show_terminal_prompt() -> str | None:
|
|
|
211
211
|
print("=" * 60)
|
|
212
212
|
print()
|
|
213
213
|
print(" Enter your API key to log training metrics to DeepFabric.")
|
|
214
|
-
print("
|
|
214
|
+
print(" You can create a key from your profile page: https://deepfabric.cloud/profile")
|
|
215
215
|
print()
|
|
216
216
|
print(" Press Enter without typing to skip (disable logging).")
|
|
217
217
|
print()
|
deepfabric/training/callback.py
CHANGED
|
@@ -43,7 +43,7 @@ class DeepFabricCallback:
|
|
|
43
43
|
|
|
44
44
|
Environment Variables:
|
|
45
45
|
DEEPFABRIC_API_KEY: API key (alternative to constructor arg)
|
|
46
|
-
DEEPFABRIC_API_URL: Backend URL (default: https://api.deepfabric.
|
|
46
|
+
DEEPFABRIC_API_URL: Backend URL (default: https://api.deepfabric.cloud)
|
|
47
47
|
"""
|
|
48
48
|
|
|
49
49
|
def __init__(
|
|
@@ -67,7 +67,7 @@ class DeepFabricCallback:
|
|
|
67
67
|
"""
|
|
68
68
|
# Get API key from arg, env, or prompt
|
|
69
69
|
self.api_key = api_key or get_api_key()
|
|
70
|
-
self.endpoint = endpoint or os.getenv("DEEPFABRIC_API_URL", "https://api.deepfabric.
|
|
70
|
+
self.endpoint = endpoint or os.getenv("DEEPFABRIC_API_URL", "https://api.deepfabric.cloud")
|
|
71
71
|
self.pipeline_id = pipeline_id or self._get_pipeline_id()
|
|
72
72
|
self.run_id = str(uuid.uuid4())
|
|
73
73
|
self.enabled = enabled and self.api_key is not None
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: DeepFabric
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.8.0
|
|
4
4
|
Summary: Curate High Quality Datasets, Train, Evaluate and Ship
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: DeepFabric Team <oss@alwaysfurther.ai>
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Requires-Python: >=3.10
|
|
8
8
|
Requires-Dist: accelerate>=0.20.0
|
|
@@ -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=
|
|
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
|
|
@@ -21,7 +21,7 @@ deepfabric/loader.py,sha256=YNTGZZE-POjR0BIlx6WCT4bIzf0T4lW_fQl7ev9UFqE,18584
|
|
|
21
21
|
deepfabric/metrics.py,sha256=iwtNHBX4ZTYUg2FZgtFcG3U0e9RlV2c1cm1Kp34FeWU,6129
|
|
22
22
|
deepfabric/progress.py,sha256=3XQQrf2pUZlyd-8eRcNATH1v0Oi8JMedVHGbhPcca-8,9354
|
|
23
23
|
deepfabric/prompts.py,sha256=JVFMeeBa2qqOMvmP_xx8bWzZ6ot9eyqOP3u8XzzPx3g,10290
|
|
24
|
-
deepfabric/schemas.py,sha256=
|
|
24
|
+
deepfabric/schemas.py,sha256=ckzAjDc6IlC8Y-Pi2hyYRqcSwARX7z_GELuCypXuSgI,37401
|
|
25
25
|
deepfabric/stream_simulator.py,sha256=GzvAxWxHVsuTwgXlqwXNfrTUDn6sND2kJOoQuYg88FA,3028
|
|
26
26
|
deepfabric/topic_manager.py,sha256=6YxMO6dQHaGyxghsI8iNJGP1miaekBe5Mh1WdYeLqdI,11164
|
|
27
27
|
deepfabric/topic_model.py,sha256=i_wYpw2kUl8NLodOSaqNu-C4_d6caYT1kPe_vkKjoyw,707
|
|
@@ -64,13 +64,13 @@ deepfabric/tools/__init__.py,sha256=hV65lJmVH2qrWCvzHb-IS3VxYP9lal1j8-J3DzBGieM,
|
|
|
64
64
|
deepfabric/tools/defaults.py,sha256=NcvrYo88OC1ID4U0CuKg_WYKz2pwFowsjBjSMZip-bI,2372
|
|
65
65
|
deepfabric/tools/loader.py,sha256=Bv56D-76JChlK_QXfHLw_rneGLZYRhkn5ETbJMIdJsA,2910
|
|
66
66
|
deepfabric/tools/mcp_client.py,sha256=uQRrlDSVwF0ZatOl9bidBNU7IgXgJKQU-xG50dK0Uy4,23377
|
|
67
|
-
deepfabric/training/__init__.py,sha256=
|
|
68
|
-
deepfabric/training/api_key_prompt.py,sha256=
|
|
69
|
-
deepfabric/training/callback.py,sha256=
|
|
67
|
+
deepfabric/training/__init__.py,sha256=MJazTELfrTB15rIiCE04hDeUL8LSSg4-4LWWG6j2BRw,1566
|
|
68
|
+
deepfabric/training/api_key_prompt.py,sha256=pSIMX3eDGyV9x_r7MHE4TyIsIB2SqYb8gKCdAtTY-q8,9371
|
|
69
|
+
deepfabric/training/callback.py,sha256=NUNrMAEYKt9kPjrX9mckvs8H4uoeVtRWPsfrjW90fWI,13051
|
|
70
70
|
deepfabric/training/dataset_utils.py,sha256=klx8DoawEwuMigBDP-RpMAfe7FvYxRbhj599MErxBr4,7313
|
|
71
|
-
deepfabric/training/metrics_sender.py,sha256=
|
|
72
|
-
deepfabric-4.
|
|
73
|
-
deepfabric-4.
|
|
74
|
-
deepfabric-4.
|
|
75
|
-
deepfabric-4.
|
|
76
|
-
deepfabric-4.
|
|
71
|
+
deepfabric/training/metrics_sender.py,sha256=ZCyvMv5hRu8XJnQYVGXJ9wh7HEMJ0l3Ktyi8_etOpZs,10833
|
|
72
|
+
deepfabric-4.8.0.dist-info/METADATA,sha256=N3ttE4MjkF2rk_Zq75-wjDds3BM0L8jEciHz8wnAnx0,20427
|
|
73
|
+
deepfabric-4.8.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
74
|
+
deepfabric-4.8.0.dist-info/entry_points.txt,sha256=zatevils13hfs8x29_vmUyivQ6rTtq7hE2RBusZw1Fo,50
|
|
75
|
+
deepfabric-4.8.0.dist-info/licenses/LICENSE,sha256=-qRt8wmrhQ9aMf7KhmZXc2vrTETYZF-6_T1KCeUhvHY,11340
|
|
76
|
+
deepfabric-4.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|