This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
40,337 additions
and
109,856 deletions.
There are no files selected for viewing
62,354 changes: 13,013 additions & 49,341 deletions
62,354
sciphi/data/stock_config/textbooks_are_all_you_need_evol/evol_grade_school.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
87,793 changes: 27,289 additions & 60,504 deletions
87,793
sciphi/data/stock_config/textbooks_are_all_you_need_evol/evol_seminar_i.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
sciphi/data/stock_config/textbooks_are_all_you_need_evol/main.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from sciphi.writers.jsonl_writer import JsonlDataWriter | ||
from sciphi.writers.raw_writer import RawDataWriter | ||
|
||
__all__ = ["JsonlDataWriter"] | ||
__all__ = ["JsonlDataWriter", "RawDataWriter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""A module which facilitates raw data writing.""" | ||
from sciphi.writers.base import DataWriter | ||
|
||
|
||
class RawDataWriter(DataWriter): | ||
"""A class to write raw data file.""" | ||
|
||
def __init__(self, output_path, overwrite=True): | ||
"""Initialize the DataWriter.""" | ||
self.output_path = output_path | ||
self.overwrite = overwrite | ||
|
||
def write(self, data: str) -> None: | ||
""" | ||
Write the provided data to the specified path. | ||
Args: | ||
data (list): List of data entries to be written. | ||
""" | ||
path = self._get_modified_path() | ||
|
||
with open(path, "a") as f: | ||
f.write(data + "\n") |