#8617·datasets

未设置“ dataset name” 时“ splitdict. copy ()” 崩溃

作者: betacatsling创建于 2026年9月14日更新于 2026年9月14日

□ 说明

SplitDict.copy ()' (和SplitDict. from split dict') 相撞 属性错误 : “ splitInfo” 对象在拆分时没有属性“ get” dict中包含"SplitInfo"对象,"dataset name"为"无".

□再现.

从数据集导入 SplitDict, SplitInfo

split dict = splitDict ({"train": SplitInfo (name="train"), num bytes=1337, num examples=42)) (中文(简体) ).
平分页( D)

追溯 :

文件 "./datasets/splits.py", 第574行, 从 split dict
数据集 名称=分拆 infos [0].get ("dataset name") 如果分拆 infos else 无
属性错误 : “ splitInfo” 对象没有属性“ get ”

□ 预期行为

副本()'应适用于持有SplitInfo'对象的`SplitDict'实例, 是构造后的正常状态(例如从数据集的信息中)。 方法应为: 条目为 “splitInfo” 对象,只返回“.get()”为生 辞典.

□ 环境

  • " 数据集 " 版本:5.0.2.dev0(主要,d336dcb)
  • Python: 3.11 (英语)

内容来源: huggingface/datasets