This repository was archived by the owner on Dec 16, 2022. It is now read-only.
File tree 1 file changed +4
-3
lines changed
allennlp/data/data_loaders
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
from collections import deque
2
2
import logging
3
3
from multiprocessing .process import BaseProcess
4
+ from os import PathLike
4
5
import random
5
6
import sys
6
7
import traceback
@@ -42,7 +43,7 @@ class MultiProcessDataLoader(DataLoader):
42
43
reader: `DatasetReader`, required
43
44
A `DatasetReader` used to load instances from the `data_path`.
44
45
45
- data_path: `str`, required
46
+ data_path: `Union[ str, PathLike] `, required
46
47
Passed to `DatasetReader.read()`.
47
48
48
49
!!! Note
@@ -139,7 +140,7 @@ class MultiProcessDataLoader(DataLoader):
139
140
def __init__ (
140
141
self ,
141
142
reader : DatasetReader ,
142
- data_path : str ,
143
+ data_path : Union [ str , PathLike ] ,
143
144
* ,
144
145
batch_size : int = None ,
145
146
drop_last : bool = False ,
@@ -180,7 +181,7 @@ def __init__(
180
181
raise ValueError ("max_instances_in_memory must be at least 1" )
181
182
182
183
self .reader = reader
183
- self .data_path = data_path
184
+ self .data_path = str ( data_path )
184
185
self .batch_size = batch_size
185
186
self .drop_last = drop_last
186
187
self .shuffle = shuffle
You can’t perform that action at this time.
0 commit comments