Skip to content

Commit 4dd23cb

Browse files
committed
mod: mod load import logic
1 parent 80e1b7e commit 4dd23cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

load.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import datasets
23
import os
34
import glob
@@ -27,8 +28,10 @@ def load_dataset(name, **kargs) -> Union[
2728
'''
2829
通过数据集名字加载数据集
2930
'''
30-
load_func = getattr(import_module('.' + name,
31-
package='fs_datasets'), 'load_dataset')
31+
import os.path
32+
HERE = os.path.dirname(os.path.abspath(__file__))
33+
sys.path.insert(0, HERE)
34+
load_func = getattr(import_module(name), 'load_dataset')
3235
return load_func(**kargs)
3336

3437

0 commit comments

Comments
 (0)