Skip to content

Commit 019de40

Browse files
committed
init transition to HF dataset
1 parent 4debb5c commit 019de40

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ dependencies = [
3232
"pytest",
3333
"pytest-cov",
3434
"litellm",
35+
"inspect-ai",
36+
"datasets",
3537
# requirements for execution
3638
"numpy",
3739
"scipy",
3840
"matplotlib",
3941
"sympy",
40-
"inspect-ai",
4142
]
4243

4344
# Classifiers help users find your project by categorizing it.

src/scicode/parse/parse.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import scipy
99
import numpy as np
1010
from sympy import Symbol
11+
from datasets import load_dataset
1112

1213
OrderedContent = list[tuple[str, str]]
1314

@@ -56,6 +57,10 @@ def read_from_jsonl(file_path):
5657
data.append(json.loads(line.strip()))
5758
return data
5859

60+
def read_from_hf_dataset(split='validation'):
61+
dataset = load_dataset('Zilinghan/scicode', split=split)
62+
return dataset
63+
5964
def rm_comments(string: str) -> str:
6065
ret_lines = []
6166
lines = string.split('\n')

0 commit comments

Comments
 (0)