langfun 0.1.2.dev202410220804__py3-none-any.whl → 0.1.2.dev202410230804__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- langfun/core/eval/base.py +15 -2
- {langfun-0.1.2.dev202410220804.dist-info → langfun-0.1.2.dev202410230804.dist-info}/METADATA +1 -1
- {langfun-0.1.2.dev202410220804.dist-info → langfun-0.1.2.dev202410230804.dist-info}/RECORD +6 -6
- {langfun-0.1.2.dev202410220804.dist-info → langfun-0.1.2.dev202410230804.dist-info}/LICENSE +0 -0
- {langfun-0.1.2.dev202410220804.dist-info → langfun-0.1.2.dev202410230804.dist-info}/WHEEL +0 -0
- {langfun-0.1.2.dev202410220804.dist-info → langfun-0.1.2.dev202410230804.dist-info}/top_level.txt +0 -0
langfun/core/eval/base.py
CHANGED
@@ -1684,10 +1684,23 @@ class Evaluation(Evaluable):
|
|
1684
1684
|
|
1685
1685
|
|
1686
1686
|
@pg.functor()
|
1687
|
-
def inputs_from(path: str | list[str]) -> list[Any]:
|
1687
|
+
def inputs_from(path: str | list[str], **kwargs) -> list[Any]:
|
1688
1688
|
"""A functor that returns a list of user-defined objects as eval inputs."""
|
1689
1689
|
if isinstance(path, str):
|
1690
|
-
|
1690
|
+
if path.endswith('.json'):
|
1691
|
+
return pg.load(path)
|
1692
|
+
elif path.endswith('.csv'):
|
1693
|
+
import pandas as pd # pylint: disable=g-import-not-at-top
|
1694
|
+
dataset_df = pd.read_csv(path, **kwargs)
|
1695
|
+
dataset = []
|
1696
|
+
for i in range(dataset_df.shape[0]):
|
1697
|
+
row = {}
|
1698
|
+
for col in dataset_df.columns:
|
1699
|
+
row[col] = dataset_df.iloc[i][col]
|
1700
|
+
dataset.append(row)
|
1701
|
+
return dataset
|
1702
|
+
else:
|
1703
|
+
raise ValueError(f'Unsupported file format: {path}')
|
1691
1704
|
examples = []
|
1692
1705
|
for p in path:
|
1693
1706
|
examples.extend(pg.load(p))
|
@@ -44,7 +44,7 @@ langfun/core/coding/python/parsing_test.py,sha256=9vAWF484kWIm6JZq8NFiMgKUDhXV-d
|
|
44
44
|
langfun/core/coding/python/permissions.py,sha256=1QWGHvzL8MM0Ok_auQ9tURqZHtdOfJaDpBzZ29GUE-c,2544
|
45
45
|
langfun/core/coding/python/permissions_test.py,sha256=w5EDb8QxpxgJyZkojyzVWQvDfg366zn99-g__6TbPQ0,2699
|
46
46
|
langfun/core/eval/__init__.py,sha256=Ogdr9OtTywhhLPHi3AZzOD2mXX2oyaHWflrSTMm96uA,1899
|
47
|
-
langfun/core/eval/base.py,sha256=
|
47
|
+
langfun/core/eval/base.py,sha256=hCblGSBirslPtthi_iz98boyu46UaOBSQ99STyw7L28,75898
|
48
48
|
langfun/core/eval/base_test.py,sha256=gAxamZKvHzT3wVr3xVtXLiwBBi5VFX1I29_QuKSR4Wg,26958
|
49
49
|
langfun/core/eval/matching.py,sha256=UnjdM_ebPqXKJamY4lvL3AYxrMIz3LqkjRTnHJ5xsYc,9349
|
50
50
|
langfun/core/eval/matching_test.py,sha256=QCoYEuf4b_1bkHqUCuRzKMbXHrV3AB2FCOBivo1stC4,5249
|
@@ -119,8 +119,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
|
|
119
119
|
langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
|
120
120
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
121
121
|
langfun/core/templates/selfplay_test.py,sha256=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
|
122
|
-
langfun-0.1.2.
|
123
|
-
langfun-0.1.2.
|
124
|
-
langfun-0.1.2.
|
125
|
-
langfun-0.1.2.
|
126
|
-
langfun-0.1.2.
|
122
|
+
langfun-0.1.2.dev202410230804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
123
|
+
langfun-0.1.2.dev202410230804.dist-info/METADATA,sha256=9vUS2Dv_sxeEb7DZ9btw1f54c33gHjHJZGPzOZth2Z8,8890
|
124
|
+
langfun-0.1.2.dev202410230804.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
125
|
+
langfun-0.1.2.dev202410230804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
126
|
+
langfun-0.1.2.dev202410230804.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{langfun-0.1.2.dev202410220804.dist-info → langfun-0.1.2.dev202410230804.dist-info}/top_level.txt
RENAMED
File without changes
|