Skip to content

Commit e380adf

Browse files
committed
fix(generate): rm max output tokens
1 parent e264513 commit e380adf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

bigcodebench/gen/util/google_request.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ def make_request(
1111
n: int,
1212
max_new_tokens: int = 2048,
1313
) -> genai.types.GenerateContentResponse:
14+
kwargs = {"temperature": temperature, "max_output_tokens": max_new_tokens}
15+
16+
if "-thinking-" in client.model_name:
17+
kwargs.pop("max_output_tokens")
18+
1419
response = client.generate_content(
1520
[{"role": "user", "parts": [message]}],
1621
generation_config=genai.types.GenerationConfig(
1722
candidate_count=n,
18-
max_output_tokens=max_new_tokens,
19-
temperature=temperature,
23+
**kwargs
2024
),
2125
safety_settings=[
2226
{"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_NONE"},
@@ -44,5 +48,4 @@ def make_auto_request(*args, **kwargs) -> genai.types.GenerateContentResponse:
4448
print("Unknown error. Waiting...")
4549
print(e)
4650
time.sleep(1)
47-
return ret
48-
51+
return ret

0 commit comments

Comments
 (0)