Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
9329fc9b
Commit
9329fc9b
authored
Jun 01, 2023
by
haileyschoelkopf
Browse files
add promptsource as an extra
parent
b698048d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
lm_eval/prompts/__init__.py
lm_eval/prompts/__init__.py
+5
-2
setup.py
setup.py
+1
-0
No files found.
lm_eval/prompts/__init__.py
View file @
9329fc9b
from
lm_eval.logger
import
eval_logger
from
promptsource.templates
import
DatasetTemplates
# TODO: decide whether we want jinja2 or f-string prompts. would it be cursed to support both?
# Prompt library.
# Stores prompts in a dictionary indexed by 2 levels:
# prompt category name, and prompt name.
...
...
@@ -23,6 +21,11 @@ def get_prompt(prompt_id: str, dataset_name=None, subset_name=None):
dataset_full_name
=
f
"
{
dataset_name
}
-
{
subset_name
}
"
eval_logger
.
info
(
f
"Loading prompt from
{
category_name
}
for
{
dataset_full_name
}
"
)
if
category_name
==
"promptsource"
:
try
:
from
promptsource.templates
import
DatasetTemplates
except
ModuleNotFoundError
:
raise
Exception
(
"Tried to load a Promptsource template, but promptsource is not installed "
,
"please install promptsource via pip install lm-eval[promptsource] or pip install -e .[promptsource]"
)
try
:
if
subset_name
is
None
:
prompts
=
DatasetTemplates
(
dataset_name
=
dataset_name
)
...
...
setup.py
View file @
9329fc9b
...
...
@@ -44,5 +44,6 @@ setuptools.setup(
"dev"
:
[
"black"
,
"flake8"
,
"pre-commit"
,
"pytest"
,
"pytest-cov"
],
"multilingual"
:
[
"nagisa>=0.2.7"
,
"jieba>=0.42.1"
],
"sentencepiece"
:
[
"sentencepiece>=0.1.98"
,
"protobuf>=4.22.1"
],
"promptsource"
:
[
"promptsource @ git+https://github.com/bigscience-workshop/promptsource.git#egg=promptsource"
]
},
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment