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
12e92616
Commit
12e92616
authored
Nov 21, 2023
by
lintangsutawika
Browse files
fixed parsing of API returns
parent
bfe69313
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
lm_eval/models/openai_completions.py
lm_eval/models/openai_completions.py
+6
-9
No files found.
lm_eval/models/openai_completions.py
View file @
12e92616
...
...
@@ -162,21 +162,18 @@ class OpenaiChatCompletionsLM(LM):
presence_penalty
=
self
.
presence_penalty
,
temperature
=
self
.
temperature
,
top_p
=
self
.
top_p
,
# stop=until,
)
for
resp
,
(
context
,
args_
)
in
zip
(
response
.
choices
,
chunk
):
print
(
resp
)
import
sys
;
sys
.
exit
()
s
=
resp
[
"text"
]
s
=
resp
.
message
.
content
# until_ = args_.get("until", ["<|endoftext|>"])
until_
=
args_
.
get
(
"until"
,
"null"
)
until_
=
args_
.
get
(
"until"
,
None
)
for
term
in
until_
:
if
len
(
term
)
>
0
:
s
=
s
.
split
(
term
)[
0
]
if
until_
is
not
None
:
for
term
in
until_
:
if
len
(
term
)
>
0
:
s
=
s
.
split
(
term
)[
0
]
# partial caching
self
.
cache_hook
.
add_partial
(
...
...
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