mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-19 12:57:58 +00:00
remove jsonlines dependency
This commit is contained in:
parent
3e1eba6e92
commit
6c64df0226
1 changed files with 2 additions and 8 deletions
|
|
@ -670,12 +670,6 @@ class BaseEnv(ABC):
|
|||
"data_dir_to_save_evals is not set, skipping evaluation logging"
|
||||
)
|
||||
return
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
import jsonlines
|
||||
|
||||
# Create directory if it doesn't exist
|
||||
os.makedirs(self.config.data_dir_to_save_evals, exist_ok=True)
|
||||
|
||||
|
|
@ -868,9 +862,9 @@ class BaseEnv(ABC):
|
|||
samples_filepath = os.path.join(
|
||||
self.config.data_dir_to_save_evals, "samples.jsonl"
|
||||
)
|
||||
with jsonlines.open(samples_filepath, "w") as writer:
|
||||
with open(samples_filepath, "w") as f:
|
||||
for sample in samples:
|
||||
writer.write(sample)
|
||||
f.write(json.dumps(sample) + "\n")
|
||||
print(f"Evaluation samples saved to {samples_filepath}")
|
||||
|
||||
@retry(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue