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
fe358061
Commit
fe358061
authored
Jul 28, 2023
by
baberabb
Browse files
added kwargs to client
parent
8ffa0e67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lm_eval/models/anthropic_llms.py
lm_eval/models/anthropic_llms.py
+4
-2
No files found.
lm_eval/models/anthropic_llms.py
View file @
fe358061
...
@@ -5,7 +5,7 @@ from tqdm import tqdm
...
@@ -5,7 +5,7 @@ from tqdm import tqdm
import
time
import
time
import
anthropic
import
anthropic
from
lm_eval.logger
import
eval_logger
from
lm_eval.logger
import
eval_logger
from
typing
import
List
,
Literal
from
typing
import
List
,
Literal
,
Any
def
anthropic_completion
(
def
anthropic_completion
(
...
@@ -57,6 +57,7 @@ class AnthropicLM(LM):
...
@@ -57,6 +57,7 @@ class AnthropicLM(LM):
model
:
str
=
"claude-2.0"
,
model
:
str
=
"claude-2.0"
,
max_tokens_to_sample
:
int
=
256
,
max_tokens_to_sample
:
int
=
256
,
temperature
:
float
=
0.0
,
temperature
:
float
=
0.0
,
**
kwargs
:
Any
,
# api_key, auth_token, etc.
):
# TODO: remove batch_size
):
# TODO: remove batch_size
"""Anthropic API wrapper.
"""Anthropic API wrapper.
...
@@ -66,7 +67,8 @@ class AnthropicLM(LM):
...
@@ -66,7 +67,8 @@ class AnthropicLM(LM):
super
().
__init__
()
super
().
__init__
()
self
.
model
=
model
self
.
model
=
model
self
.
client
=
anthropic
.
Anthropic
()
# defaults to os.environ.get("ANTHROPIC_API_KEY")
self
.
client
=
anthropic
.
Anthropic
(
**
kwargs
)
self
.
temperature
=
temperature
self
.
temperature
=
temperature
self
.
max_tokens_to_sample
=
max_tokens_to_sample
self
.
max_tokens_to_sample
=
max_tokens_to_sample
self
.
tokenizer
=
self
.
client
.
get_tokenizer
()
self
.
tokenizer
=
self
.
client
.
get_tokenizer
()
...
...
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