Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] output sequence under the multiple samples #1707

Merged
merged 15 commits into from
Nov 26, 2024
Prev Previous commit
Next Next commit
update
  • Loading branch information
cuauty committed Nov 21, 2024
commit 645778fe364a82cbfb8329ef3f3f5487fa03c7f2
16 changes: 5 additions & 11 deletions opencompass/models/bailing_api_oc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import os
import socket
import time
import traceback
from typing import Dict, List, Optional, Union

import requests
from requests.adapters import HTTPAdapter
from requests.exceptions import ConnectionError
from urllib3.connection import HTTPConnection

try:
Expand Down Expand Up @@ -104,7 +104,7 @@ def __init__(
def generate(
self,
inputs: Union[List[str], PromptList],
max_out_len: int = 4096,
max_out_len: int = 11264,
) -> List[str]:
"""Generate results given a list of inputs.

Expand Down Expand Up @@ -193,15 +193,9 @@ def _generate(
message['role'] = item['role']
messages.append(message)
request = {
'model':
self._model,
'messages':
messages,
'max_tokens':
max(
max_out_len if max_out_len else 4096,
self.max_seq_len if self.max_seq_len else 4096,
),
'model': self._model,
'messages': messages,
'max_tokens': 11264
}
request.update(self.generation_kwargs)
try:
Expand Down
Loading