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
ba9c13b2
Commit
ba9c13b2
authored
Feb 22, 2021
by
Leo Gao
Browse files
Fix translation context
parent
03f34463
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
7 deletions
+2
-7
lm_eval/models/dummy.py
lm_eval/models/dummy.py
+2
-1
lm_eval/tasks/translation.py
lm_eval/tasks/translation.py
+0
-6
No files found.
lm_eval/models/dummy.py
View file @
ba9c13b2
...
...
@@ -21,7 +21,8 @@ class DummyLM(LM):
def
greedy_until
(
self
,
requests
):
res
=
[]
for
_
in
requests
:
for
ctx
,
_
in
requests
:
res
.
append
(
"lol"
)
assert
ctx
.
strip
()
!=
''
return
res
lm_eval/tasks/translation.py
View file @
ba9c13b2
...
...
@@ -145,12 +145,6 @@ class GeneralTranslationTask(Task):
tar_lang
=
code_to_language
(
language_codes
[
1
])
return
f
"Translate these
{
src_lang
}
phrases to
{
tar_lang
}
."
# TODO This should be something like
# French: {src_line}
# English: {ref_line}
def
fewshot_context
(
self
,
doc
,
num_fewshot
,
provide_description
):
return
""
def
__str__
(
self
):
language_codes
=
self
.
sacrebleu_language_pair
.
split
(
"-"
)
src_lang
=
code_to_language
(
language_codes
[
0
])
...
...
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