mdify-cli 2.11.8__py3-none-any.whl → 2.11.9__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.
- mdify/__init__.py +1 -1
- mdify/cli.py +38 -4
- {mdify_cli-2.11.8.dist-info → mdify_cli-2.11.9.dist-info}/METADATA +1 -1
- mdify_cli-2.11.9.dist-info/RECORD +12 -0
- mdify_cli-2.11.8.dist-info/RECORD +0 -12
- {mdify_cli-2.11.8.dist-info → mdify_cli-2.11.9.dist-info}/WHEEL +0 -0
- {mdify_cli-2.11.8.dist-info → mdify_cli-2.11.9.dist-info}/entry_points.txt +0 -0
- {mdify_cli-2.11.8.dist-info → mdify_cli-2.11.9.dist-info}/licenses/LICENSE +0 -0
- {mdify_cli-2.11.8.dist-info → mdify_cli-2.11.9.dist-info}/top_level.txt +0 -0
mdify/__init__.py
CHANGED
mdify/cli.py
CHANGED
|
@@ -116,11 +116,17 @@ def parse_memory_string(mem_str: str) -> float:
|
|
|
116
116
|
raise ValueError(f"Invalid memory format: {mem_str}")
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
def validate_memory_availability(
|
|
119
|
+
def validate_memory_availability(
|
|
120
|
+
required_gb: float,
|
|
121
|
+
profile_name: str = "default",
|
|
122
|
+
suggest_profile: Optional[str] = None,
|
|
123
|
+
) -> tuple[bool, str]:
|
|
120
124
|
"""Check if system has sufficient available memory.
|
|
121
125
|
|
|
122
126
|
Args:
|
|
123
127
|
required_gb: Required memory in GB
|
|
128
|
+
profile_name: Name of current profile being used
|
|
129
|
+
suggest_profile: Name of smaller profile to suggest (auto-detected if None)
|
|
124
130
|
|
|
125
131
|
Returns:
|
|
126
132
|
Tuple of (is_sufficient, error_message)
|
|
@@ -132,13 +138,39 @@ def validate_memory_availability(required_gb: float) -> tuple[bool, str]:
|
|
|
132
138
|
return True, ""
|
|
133
139
|
|
|
134
140
|
if available_gb < required_gb:
|
|
141
|
+
# Determine which smaller profile to suggest
|
|
142
|
+
if suggest_profile is None:
|
|
143
|
+
if profile_name == "heavy":
|
|
144
|
+
suggest_profile = "default"
|
|
145
|
+
elif profile_name == "default":
|
|
146
|
+
suggest_profile = "minimal"
|
|
147
|
+
else:
|
|
148
|
+
suggest_profile = None # Already on minimal
|
|
149
|
+
|
|
135
150
|
error = (
|
|
136
151
|
f"Insufficient memory available for container startup.\n"
|
|
152
|
+
f" Current profile: {profile_name}\n"
|
|
137
153
|
f" Required: {required_gb:.1f} GB\n"
|
|
138
154
|
f" Available: {available_gb:.1f} GB\n"
|
|
139
155
|
f" Short by: {required_gb - available_gb:.1f} GB\n\n"
|
|
140
|
-
f"Please close other applications or use a smaller profile (--profile minimal)"
|
|
141
156
|
)
|
|
157
|
+
|
|
158
|
+
if suggest_profile:
|
|
159
|
+
suggested = RESOURCE_PROFILES[suggest_profile]
|
|
160
|
+
error += (
|
|
161
|
+
f"Suggested solutions:\n"
|
|
162
|
+
f" 1. Close other applications to free up memory\n"
|
|
163
|
+
f" 2. Use a smaller profile: --profile {suggest_profile} "
|
|
164
|
+
f"({suggested['cpus']} CPUs, {suggested['memory']} memory)\n"
|
|
165
|
+
f" 3. Skip memory check: --skip-memory-check (not recommended)"
|
|
166
|
+
)
|
|
167
|
+
else:
|
|
168
|
+
error += (
|
|
169
|
+
f"Suggested solutions:\n"
|
|
170
|
+
f" 1. Close other applications to free up memory\n"
|
|
171
|
+
f" 2. Skip memory check: --skip-memory-check (not recommended)"
|
|
172
|
+
)
|
|
173
|
+
|
|
142
174
|
return False, error
|
|
143
175
|
|
|
144
176
|
return True, ""
|
|
@@ -1082,7 +1114,7 @@ def main() -> int:
|
|
|
1082
1114
|
|
|
1083
1115
|
try:
|
|
1084
1116
|
if not args.quiet:
|
|
1085
|
-
print(f"Starting docling-serve container
|
|
1117
|
+
print(f"Starting docling-serve container...\n")
|
|
1086
1118
|
|
|
1087
1119
|
# Apply resource profile
|
|
1088
1120
|
profile = RESOURCE_PROFILES[args.profile]
|
|
@@ -1092,7 +1124,9 @@ def main() -> int:
|
|
|
1092
1124
|
# Validate memory availability unless skipped
|
|
1093
1125
|
if not args.skip_memory_check:
|
|
1094
1126
|
required_gb = parse_memory_string(memory)
|
|
1095
|
-
is_sufficient, error_msg = validate_memory_availability(
|
|
1127
|
+
is_sufficient, error_msg = validate_memory_availability(
|
|
1128
|
+
required_gb, profile_name=args.profile
|
|
1129
|
+
)
|
|
1096
1130
|
if not is_sufficient:
|
|
1097
1131
|
print(f"Error: {error_msg}", file=sys.stderr)
|
|
1098
1132
|
return 1
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
assets/mdify.png,sha256=qUj7WXWqNwpI2KNXOW79XJwqFqa-UI0JEkmt1mmy4Rg,1820418
|
|
2
|
+
mdify/__init__.py,sha256=x2PxT1laVq9WFwgXBDy1TJ_qCOBN4cxlmLYbSBcb7qA,91
|
|
3
|
+
mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
|
|
4
|
+
mdify/cli.py,sha256=Mv3ClwC84fkorZgwM1IqGMvZ0-hT_V77qhHo2p0ueCU,49638
|
|
5
|
+
mdify/container.py,sha256=ARdFs-TOSh5vHGtBJ0CppfpZFaiprIuRdQ5wDH0NfrY,8377
|
|
6
|
+
mdify/docling_client.py,sha256=xuQR6sC1v3EPloOSwExoHCqT4uUxE8myYq-Yeby3C2I,7975
|
|
7
|
+
mdify_cli-2.11.9.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
|
|
8
|
+
mdify_cli-2.11.9.dist-info/METADATA,sha256=NHwtbgGo2CAPqZIOT7ebPk5mTwsmxRBo5pg0l71xenE,9623
|
|
9
|
+
mdify_cli-2.11.9.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
mdify_cli-2.11.9.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
|
|
11
|
+
mdify_cli-2.11.9.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
|
|
12
|
+
mdify_cli-2.11.9.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
assets/mdify.png,sha256=qUj7WXWqNwpI2KNXOW79XJwqFqa-UI0JEkmt1mmy4Rg,1820418
|
|
2
|
-
mdify/__init__.py,sha256=2o-AESFmF0rXXPkxbMNN-Qq9wmMK4wpqdFbx-_W-5Vw,91
|
|
3
|
-
mdify/__main__.py,sha256=bhpJ00co6MfaVOdH4XLoW04NtLYDa_oJK7ODzfLrn9M,143
|
|
4
|
-
mdify/cli.py,sha256=4LIl9szxndnt57pq20DyQq7_Eco9Z6DxssNgC_8EQKM,48317
|
|
5
|
-
mdify/container.py,sha256=ARdFs-TOSh5vHGtBJ0CppfpZFaiprIuRdQ5wDH0NfrY,8377
|
|
6
|
-
mdify/docling_client.py,sha256=xuQR6sC1v3EPloOSwExoHCqT4uUxE8myYq-Yeby3C2I,7975
|
|
7
|
-
mdify_cli-2.11.8.dist-info/licenses/LICENSE,sha256=NWM66Uv-XuSMKaU-gaPmvfyk4WgE6zcIPr78wyg6GAo,1065
|
|
8
|
-
mdify_cli-2.11.8.dist-info/METADATA,sha256=LjsY8TyklrMNr-EtVgrgQ8cdbhMNm7e8XBz0nxkfRA4,9623
|
|
9
|
-
mdify_cli-2.11.8.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
-
mdify_cli-2.11.8.dist-info/entry_points.txt,sha256=0Xki8f5lADQUtwdt6Eq_FEaieI6Byhk8UE7BuDhChMg,41
|
|
11
|
-
mdify_cli-2.11.8.dist-info/top_level.txt,sha256=qltzf7h8owHq7dxCdfCkSHY8gT21hn1_E8P-VWS_OKM,6
|
|
12
|
-
mdify_cli-2.11.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|