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
57272b63
You need to sign in or sign up before continuing.
Unverified
Commit
57272b63
authored
Oct 30, 2024
by
Samuel Monson
Committed by
GitHub
Oct 30, 2024
Browse files
Add verify_certificate argument to local-completion (#2440)
parent
b40a20ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
docs/API_guide.md
docs/API_guide.md
+4
-0
lm_eval/models/api_models.py
lm_eval/models/api_models.py
+3
-0
No files found.
docs/API_guide.md
View file @
57272b63
...
@@ -91,6 +91,10 @@ When initializing a `TemplateAPI` instance or a subclass, you can provide severa
...
@@ -91,6 +91,10 @@ When initializing a `TemplateAPI` instance or a subclass, you can provide severa
-
Custom token ID to use as a prefix for inputs.
-
Custom token ID to use as a prefix for inputs.
-
If not provided, uses the model's default BOS or EOS token (if
`add_bos_token`
is True).
-
If not provided, uses the model's default BOS or EOS token (if
`add_bos_token`
is True).
-
`verify_certificate`
(bool, optional):
-
Whether to validate the certificate of the API endpoint (if HTTPS).
-
Default is True.
Example usage:
Example usage:
...
...
lm_eval/models/api_models.py
View file @
57272b63
...
@@ -79,6 +79,7 @@ class TemplateAPI(TemplateLM):
...
@@ -79,6 +79,7 @@ class TemplateAPI(TemplateLM):
trust_remote_code
:
bool
=
False
,
trust_remote_code
:
bool
=
False
,
revision
:
Optional
[
str
]
=
"main"
,
revision
:
Optional
[
str
]
=
"main"
,
use_fast_tokenizer
:
bool
=
True
,
use_fast_tokenizer
:
bool
=
True
,
verify_certificate
:
bool
=
True
,
**
kwargs
,
**
kwargs
,
)
->
None
:
)
->
None
:
super
().
__init__
()
super
().
__init__
()
...
@@ -120,6 +121,7 @@ class TemplateAPI(TemplateLM):
...
@@ -120,6 +121,7 @@ class TemplateAPI(TemplateLM):
self
.
custom_prefix_token_id
=
custom_prefix_token_id
self
.
custom_prefix_token_id
=
custom_prefix_token_id
self
.
tokenized_requests
=
tokenized_requests
self
.
tokenized_requests
=
tokenized_requests
self
.
max_retries
=
int
(
max_retries
)
self
.
max_retries
=
int
(
max_retries
)
self
.
verify_certificate
=
verify_certificate
eval_logger
.
info
(
f
"Using tokenizer
{
self
.
tokenizer_backend
}
"
)
eval_logger
.
info
(
f
"Using tokenizer
{
self
.
tokenizer_backend
}
"
)
if
self
.
tokenizer_backend
is
None
:
if
self
.
tokenizer_backend
is
None
:
...
@@ -342,6 +344,7 @@ class TemplateAPI(TemplateLM):
...
@@ -342,6 +344,7 @@ class TemplateAPI(TemplateLM):
**
kwargs
,
**
kwargs
,
),
),
headers
=
self
.
header
,
headers
=
self
.
header
,
verify
=
self
.
verify_certificate
,
)
)
if
not
response
.
ok
:
if
not
response
.
ok
:
eval_logger
.
warning
(
eval_logger
.
warning
(
...
...
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