Skip to content

Commit d60a931

Browse files
committed
* refine args and messages
1 parent 2c7fd58 commit d60a931

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

trinity/buffer/reader/file_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def read(self, strategy: Optional[ReadStrategy] = None):
234234

235235
@FILE_READERS.register_module("raw")
236236
class RawDataReader(BufferReader):
237-
def __init__(self, meta: StorageConfig, config: BufferConfig):
237+
def __init__(self, meta: StorageConfig, config: Optional[BufferConfig]):
238238
self.returned = False
239239
self.dataset = load_dataset(meta.path, name=meta.subset_name, split=meta.split)
240240

trinity/buffer/writer/file_writer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Writer of the File buffer."""
22
import os
3-
from typing import List
3+
from typing import List, Optional
44

55
import jsonlines as jl
66

@@ -15,13 +15,13 @@
1515
class RawFileWriter(BufferWriter):
1616
"""Writer of the Queue buffer."""
1717

18-
def __init__(self, meta: StorageConfig, config: BufferConfig):
18+
def __init__(self, meta: StorageConfig, config: Optional[BufferConfig]):
1919
assert meta.storage_type == StorageType.FILE
2020
if meta.path is None:
2121
raise ValueError("File path cannot be None for RawFileWriter")
2222
ext = os.path.splitext(meta.path)[-1]
2323
if ext != ".jsonl":
24-
raise ValueError(f"File path must end with .json or .jsonl, got {meta.path}")
24+
raise ValueError(f"File path must end with .jsonl, got {meta.path}")
2525
self.writer = jl.open(meta.path, mode="a")
2626

2727
def write(self, data: List) -> None:

0 commit comments

Comments
 (0)