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
ccf4a58a
Commit
ccf4a58a
authored
Feb 20, 2025
by
Baber
Browse files
add ruler
parent
527a4352
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
10 deletions
+0
-10
lm_eval/tasks/ruler/essays.py
lm_eval/tasks/ruler/essays.py
+0
-9
lm_eval/tasks/ruler/fwe_utils.py
lm_eval/tasks/ruler/fwe_utils.py
+0
-1
No files found.
lm_eval/tasks/ruler/essays.py
View file @
ccf4a58a
...
...
@@ -108,21 +108,12 @@ async def get_essays() -> Dict[str, str]:
files_repo
=
sorted
(
glob
.
glob
(
os
.
path
.
join
(
temp_folder_repo
,
"*.txt"
)))
files_html
=
sorted
(
glob
.
glob
(
os
.
path
.
join
(
temp_folder_html
,
"*.txt"
)))
# print(
# f"Downloaded {len(files_repo)} essays from `https://github.com/gkamradt/LLMTest_NeedleInAHaystack/`"
# )
# print(f"Downloaded {len(files_html)} essays from `http://www.paulgraham.com/`")
# Combine all texts
text
=
""
for
file
in
files_repo
+
files_html
:
with
open
(
file
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
text
+=
f
.
read
()
# Cleanup
# shutil.rmtree(temp_folder_repo)
# shutil.rmtree(temp_folder_html)
return
{
"text"
:
text
}
...
...
lm_eval/tasks/ruler/fwe_utils.py
View file @
ccf4a58a
...
...
@@ -108,7 +108,6 @@ def sys_kwext(
incremental
=
input_max_len
//
32
,
alpha
=
alpha
,
)
# print("num_example_words:", num_example_words)
# Generate samples
for
index
in
tqdm
(
range
(
num_samples
),
desc
=
f
"Generating FWE Samples |
{
max_seq_length
}
"
...
...
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