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
2d433a4a
Unverified
Commit
2d433a4a
authored
Nov 03, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Nov 03, 2023
Browse files
Update and rename ggml.py to gguf.py
parent
32f2bcf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
lm_eval/models/gguf.py
lm_eval/models/gguf.py
+4
-4
No files found.
lm_eval/models/gg
ml
.py
→
lm_eval/models/gg
uf
.py
View file @
2d433a4a
...
...
@@ -31,7 +31,7 @@ def get_result(logprobs, context_lenght):
return
continuation_logprobs
,
is_greedy
class
GG
ML
LM
(
BaseLM
):
class
GG
UF
LM
(
BaseLM
):
def
__init__
(
self
,
base_url
,
truncate
=
False
):
super
().
__init__
()
self
.
base_url
=
base_url
...
...
@@ -42,7 +42,7 @@ class GGMLLM(BaseLM):
self
.
max_length
=
1024
self
.
vocab_size
=
self
.
tokenizer
.
vocab_size
def
gg
ml
_completion
(
self
,
context
,
continuation
=
None
,
stop
=
None
,
retries
=
3
,
delay
=
5
,
**
kwargs
):
def
gg
uf
_completion
(
self
,
context
,
continuation
=
None
,
stop
=
None
,
retries
=
3
,
delay
=
5
,
**
kwargs
):
for
_
in
range
(
retries
):
try
:
prompt
=
context
...
...
@@ -67,7 +67,7 @@ class GGMLLM(BaseLM):
return
[]
res
=
[]
for
context
,
continuation
in
tqdm
(
requests
):
response
=
self
.
gg
ml
_completion
(
context
=
context
,
continuation
=
continuation
)
response
=
self
.
gg
uf
_completion
(
context
=
context
,
continuation
=
continuation
)
if
response
and
"choices"
in
response
and
response
[
"choices"
]:
choice
=
response
[
"choices"
][
0
]
logprobs
=
choice
.
get
(
"logprobs"
)
...
...
@@ -90,7 +90,7 @@ class GGMLLM(BaseLM):
inp
=
request
[
0
]
request_args
=
request
[
1
]
until
=
request_args
[
"until"
]
response
=
self
.
gg
ml
_completion
(
context
=
inp
,
stop
=
until
)
response
=
self
.
gg
uf
_completion
(
context
=
inp
,
stop
=
until
)
if
response
and
"choices"
in
response
and
response
[
"choices"
]:
choice
=
response
[
"choices"
][
0
]
if
"text"
in
choice
:
...
...
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