dtflow 0.3.0__py3-none-any.whl → 0.3.2__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.
- dtflow/__init__.py +70 -43
- dtflow/__main__.py +301 -239
- dtflow/cli/__init__.py +29 -2
- dtflow/cli/commands.py +1112 -113
- dtflow/converters.py +39 -23
- dtflow/core.py +140 -72
- dtflow/lineage.py +410 -0
- dtflow/mcp/__init__.py +1 -0
- dtflow/mcp/__main__.py +2 -0
- dtflow/mcp/cli.py +35 -17
- dtflow/mcp/docs.py +0 -5
- dtflow/pipeline.py +460 -0
- dtflow/presets.py +24 -22
- dtflow/storage/__init__.py +11 -10
- dtflow/storage/io.py +384 -369
- dtflow/streaming.py +656 -0
- dtflow/tokenizers.py +212 -57
- dtflow/utils/__init__.py +2 -1
- dtflow/utils/display.py +28 -27
- {dtflow-0.3.0.dist-info → dtflow-0.3.2.dist-info}/METADATA +153 -7
- dtflow-0.3.2.dist-info/RECORD +24 -0
- dtflow-0.3.0.dist-info/RECORD +0 -21
- {dtflow-0.3.0.dist-info → dtflow-0.3.2.dist-info}/WHEEL +0 -0
- {dtflow-0.3.0.dist-info → dtflow-0.3.2.dist-info}/entry_points.txt +0 -0
dtflow/__init__.py
CHANGED
|
@@ -7,61 +7,88 @@ DataTransformer: 简洁的数据格式转换工具
|
|
|
7
7
|
- tokenizers: Token 统计和过滤
|
|
8
8
|
- converters: HuggingFace/OpenAI 等格式转换
|
|
9
9
|
"""
|
|
10
|
+
|
|
11
|
+
from .converters import ( # LLaMA-Factory 扩展; ms-swift
|
|
12
|
+
from_hf_dataset,
|
|
13
|
+
from_openai_batch,
|
|
14
|
+
messages_to_text,
|
|
15
|
+
to_axolotl,
|
|
16
|
+
to_hf_chat_format,
|
|
17
|
+
to_hf_dataset,
|
|
18
|
+
to_llama_factory,
|
|
19
|
+
to_llama_factory_sharegpt,
|
|
20
|
+
to_llama_factory_vlm,
|
|
21
|
+
to_llama_factory_vlm_sharegpt,
|
|
22
|
+
to_openai_batch,
|
|
23
|
+
to_swift_messages,
|
|
24
|
+
to_swift_query_response,
|
|
25
|
+
to_swift_vlm,
|
|
26
|
+
)
|
|
10
27
|
from .core import DataTransformer, DictWrapper, TransformError, TransformErrors
|
|
11
28
|
from .presets import get_preset, list_presets
|
|
12
|
-
from .storage import
|
|
29
|
+
from .storage import load_data, sample_file, save_data
|
|
30
|
+
from .streaming import StreamingTransformer, load_sharded, load_stream, process_shards
|
|
13
31
|
from .tokenizers import (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
DEFAULT_MODEL,
|
|
33
|
+
MODEL_ALIASES,
|
|
34
|
+
OPENAI_MODELS,
|
|
35
|
+
count_tokens,
|
|
36
|
+
messages_token_counter,
|
|
37
|
+
messages_token_filter,
|
|
38
|
+
messages_token_stats,
|
|
39
|
+
resolve_model,
|
|
40
|
+
token_counter,
|
|
41
|
+
token_filter,
|
|
42
|
+
token_stats,
|
|
25
43
|
)
|
|
26
44
|
|
|
27
|
-
__version__ =
|
|
45
|
+
__version__ = "0.3.2"
|
|
28
46
|
|
|
29
47
|
__all__ = [
|
|
30
48
|
# core
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
49
|
+
"DataTransformer",
|
|
50
|
+
"DictWrapper",
|
|
51
|
+
"TransformError",
|
|
52
|
+
"TransformErrors",
|
|
35
53
|
# presets
|
|
36
|
-
|
|
37
|
-
|
|
54
|
+
"get_preset",
|
|
55
|
+
"list_presets",
|
|
38
56
|
# storage
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
57
|
+
"save_data",
|
|
58
|
+
"load_data",
|
|
59
|
+
"sample_file",
|
|
42
60
|
# tokenizers
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
"count_tokens",
|
|
62
|
+
"token_counter",
|
|
63
|
+
"token_filter",
|
|
64
|
+
"token_stats",
|
|
65
|
+
"messages_token_counter",
|
|
66
|
+
"messages_token_filter",
|
|
67
|
+
"messages_token_stats",
|
|
68
|
+
"DEFAULT_MODEL",
|
|
69
|
+
"MODEL_ALIASES",
|
|
70
|
+
"OPENAI_MODELS",
|
|
71
|
+
"resolve_model",
|
|
50
72
|
# converters
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
73
|
+
"to_hf_dataset",
|
|
74
|
+
"from_hf_dataset",
|
|
75
|
+
"to_hf_chat_format",
|
|
76
|
+
"from_openai_batch",
|
|
77
|
+
"to_openai_batch",
|
|
78
|
+
"to_llama_factory",
|
|
79
|
+
"to_axolotl",
|
|
80
|
+
"messages_to_text",
|
|
59
81
|
# LLaMA-Factory 扩展
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
"to_llama_factory_sharegpt",
|
|
83
|
+
"to_llama_factory_vlm",
|
|
84
|
+
"to_llama_factory_vlm_sharegpt",
|
|
63
85
|
# ms-swift
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
86
|
+
"to_swift_messages",
|
|
87
|
+
"to_swift_query_response",
|
|
88
|
+
"to_swift_vlm",
|
|
89
|
+
# streaming
|
|
90
|
+
"StreamingTransformer",
|
|
91
|
+
"load_stream",
|
|
92
|
+
"load_sharded",
|
|
93
|
+
"process_shards",
|
|
67
94
|
]
|