mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
add temperature in alles (#787)
This commit is contained in:
parent
ad872a5dc2
commit
5679edb490
@ -334,6 +334,7 @@ class OpenAIAllesAPIN(OpenAI):
|
||||
path: str,
|
||||
url: str,
|
||||
key: str,
|
||||
temperature: float = 1.0,
|
||||
query_per_second: int = 1,
|
||||
rpm_verbose: bool = False,
|
||||
max_seq_len: int = 2048,
|
||||
@ -346,6 +347,7 @@ class OpenAIAllesAPIN(OpenAI):
|
||||
meta_template=meta_template,
|
||||
retry=retry)
|
||||
self.url = url
|
||||
self.temperature = temperature
|
||||
self.headers = {
|
||||
'alles-apin-token': key,
|
||||
'content-type': 'application/json',
|
||||
@ -387,11 +389,12 @@ class OpenAIAllesAPIN(OpenAI):
|
||||
# model can be response with user and system
|
||||
# when it comes with agent involved.
|
||||
assert msg['role'] in ['user', 'system']
|
||||
|
||||
data = {
|
||||
'model': self.path,
|
||||
'messages': messages,
|
||||
'temperature': temperature
|
||||
}
|
||||
|
||||
for _ in range(self.retry):
|
||||
self.wait()
|
||||
raw_response = requests.post(self.url,
|
||||
|
Loading…
Reference in New Issue
Block a user