Skip to content

Commit 77d6a07

Browse files
authored
Merge pull request #119 from sbintuitions/smart_open
Use `smart_open` for jsonl loading
2 parents f9b260a + 8661c70 commit 77d6a07

File tree

6 files changed

+106
-1
lines changed

6 files changed

+106
-1
lines changed

flexeval/core/chat_dataset/template_based.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import datasets
88
from jinja2 import Template
9+
from smart_open import open
910

1011
from flexeval.core.utils.jinja2_utils import JINJA2_ENV
1112

flexeval/core/generation_dataset/template_based.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import datasets
88
from jinja2 import Template
9+
from smart_open import open
910

1011
from flexeval.core.utils.jinja2_utils import JINJA2_ENV
1112

flexeval/core/reward_bench_dataset/template_based.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import datasets
77
from jinja2 import Template
8+
from smart_open import open
89

910
from flexeval.core.utils.jinja2_utils import JINJA2_ENV
1011

flexeval/core/text_dataset/jsonl.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import json
44
from os import PathLike
55

6+
from smart_open import open
7+
68
from .base import TextDataset, TextInstance
79

810

poetry.lock

Lines changed: 100 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ loguru = "^0.7.2"
3434
wandb = {version = "^0.17.2", optional = true}
3535
pyarrow = "16.1.0" # set the version because we get "Unable to find installation candidates" with 17.0.0
3636
scipy = "1.13.0"
37+
smart-open = "^7.1.0"
3738

3839
[tool.poetry.extras]
3940
vllm = ["vllm"]

0 commit comments

Comments
 (0)