@icyfenix-dmla/cli 2026.5.29-2018 → 2026.5.29-2149

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icyfenix-dmla/cli",
3
- "version": "2026.5.29-2018",
3
+ "version": "2026.5.29-2149",
4
4
  "description": "DMLA 沙箱服务命令行工具",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -53,6 +53,9 @@ class SFTDataset(Dataset):
53
53
 
54
54
  def create_chat_prompt(self, conversations):
55
55
  """将对话列表应用 chat template 转为文本"""
56
+ # DataLoader 多 worker 场景下 tokenizer.chat_template 可能丢失,需防御性设置
57
+ if not self.tokenizer.chat_template:
58
+ self.tokenizer.chat_template = self.CHATML_TEMPLATE
56
59
  messages = []
57
60
  tools = None
58
61
  for message in conversations:
@@ -83,7 +83,7 @@ const DATASETS = [
83
83
  id: 'minimind-sft',
84
84
  name: 'MiniMind SFT (LLM监督微调语料)',
85
85
  url: 'https://www.modelscope.cn/datasets/icyfenix/Minimind_SFT.git',
86
- size: '~1.7GB',
86
+ size: '~90MB',
87
87
  format: 'git',
88
88
  targetDir: 'datasets/minimind-sft',
89
89
  source: 'ModelScope (icyfenix)'
@@ -306,10 +306,45 @@ matplotlib.use('module://matplotlib_inline.backend_inline')
306
306
 
307
307
  # 处理不同类型的输出
308
308
  if msg_type == 'stream':
309
+ stream_name = content.get('name', 'stdout')
310
+ stream_text = content.get('text', '')
311
+
312
+ # 从 stderr 中提取 ProgressReporter 的 progress JSON,
313
+ # 作为独立的 progress 类型消息发送,避免与普通 stderr 输出混合
314
+ if stream_name == 'stderr':
315
+ progress_lines = []
316
+ other_lines = []
317
+ for line in stream_text.split('\n'):
318
+ if line.startswith('{"type": "progress"') or line.startswith('{"type":"progress"'):
319
+ progress_lines.append(line)
320
+ else:
321
+ other_lines.append(line)
322
+
323
+ # 将 progress JSON 作为独立消息发送(字段展开到顶层,与前端 progress case 匹配)
324
+ for pline in progress_lines:
325
+ if not pline.strip():
326
+ continue
327
+ try:
328
+ import json as _json
329
+ progress_data = _json.loads(pline)
330
+ progress_data['type'] = 'progress'
331
+ if stream:
332
+ output_json(progress_data)
333
+ else:
334
+ outputs.append(progress_data)
335
+ except Exception:
336
+ # JSON 解析失败,作为普通文本处理
337
+ other_lines.append(pline)
338
+
339
+ # 剩余 stderr 内容正常传递
340
+ stream_text = '\n'.join(other_lines)
341
+ if not stream_text.strip():
342
+ continue
343
+
309
344
  stream_output = {
310
345
  'type': 'stream',
311
- 'name': content.get('name', 'stdout'),
312
- 'text': content.get('text', '')
346
+ 'name': stream_name,
347
+ 'text': stream_text
313
348
  }
314
349
 
315
350
  if stream:
@@ -317,7 +352,7 @@ matplotlib.use('module://matplotlib_inline.backend_inline')
317
352
  output_json(stream_output)
318
353
  else:
319
354
  outputs.append(stream_output)
320
- log_debug(f'Stream output: {content.get("name")} len={len(content.get("text", ""))}')
355
+ log_debug(f'Stream output: {stream_name} len={len(stream_text)}')
321
356
 
322
357
  elif msg_type == 'display_data':
323
358
  display_output = {
@@ -982,10 +982,11 @@ export async function runPythonCodeStreaming(code, useGpu = false, res, imageOve
982
982
  if (isJsonComplete(text)) {
983
983
  log(`Forwarding complete JSON message: ${text.length} bytes`)
984
984
  res.write(text + '\n')
985
- // chat 模式:检测 idle 消息,设置 ChatManager 就绪
985
+ // chat 模式:将消息转发给 ChatManager 处理
986
986
  if (mode === 'chat') {
987
987
  try {
988
988
  const msg = JSON.parse(text)
989
+ chatManager.handleDockerStream(Buffer.from(text + '\n'))
989
990
  if (msg.type === 'idle') {
990
991
  chatManager.setReady(true)
991
992
  log('ChatManager ready (idle message received)')
package/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "buildTime": "2026-05-29T12:19:03.854Z",
3
- "cliVersion": "2026.5.29-2018"
2
+ "buildTime": "2026-05-29T13:50:24.219Z",
3
+ "cliVersion": "2026.5.29-2149"
4
4
  }