ModelScope Windows环境下 数据集使用指南.ipynb 示例报错
发现Windows执行环境下Lib\site-packages\datasets\builder.py 判断结果is_local 出错, 参考代码如下:
if self._file_format is not None and self._file_format != 'arrow':
raise FileFormatError('Loading a dataset not written in the 'arrow' format is not supported.')
# is_local返回结果为false
is_local = not is_remote_filesystem(self._fs)
# 抛出异常
if not is_local:
raise NotImplementedError(f'Loading a dataset cached in a {type(self._fs).__name__} is not supported.')
if not os.path.exists(self._output_dir):
raise FileNotFoundError(
f'Dataset {self.name}: could not find data in {self._output_dir}. Please make sure to call '
'builder.download_and_prepare(), or use '
'datasets.load_dataset() before trying to access the Dataset object.'
)
根据Windows下调试反馈结果,修改Lib\site-packages\datasets\filesystems__init__.py 文件暂时解决
# Windows环境下存在以List形式返回的fs.protocol对象 2023/12/01
# if fs is not None and fs.protocol != 'file'
if fs is not None and fs.protocol != 'file' and fs.protocol[0] != 'file':
return True
else:
return False
重新打开jupyter 代码执行成功
赞0
踩0