-
Notifications
You must be signed in to change notification settings - Fork 2
Small fixes + gemini 2.5 #3
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,11 +33,14 @@ | |
from cosette import Client as CosetteClient | ||
from vertexauth import get_claudette_client | ||
from openai import AzureOpenAI | ||
azure_endpoint = AzureOpenAI( | ||
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"), | ||
api_key=os.getenv("AZURE_OPENAI_API_KEY"), | ||
api_version="2024-12-01-preview", | ||
) | ||
try: | ||
# Azure secrets should be set if using Azure OpenAI models | ||
azure_endpoint = AzureOpenAI( | ||
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"), | ||
api_key=os.getenv("AZURE_OPENAI_API_KEY"), | ||
api_version="2024-12-01-preview", | ||
) | ||
except Exception as e: pass | ||
Comment on lines
+36
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the Claudette client, azure client/endpoint is needed only when running OpenAI, so it's optional |
||
|
||
import babilong_prompts as bp | ||
import longbench_prompts as lbp | ||
|
@@ -117,6 +120,10 @@ def question_tag(ds: str, rec: dict) -> str | None: | |
"o3-mini-2025-01-31": {"in": 1.10 / 1_000_000, "out": 4.40 / 1_000_000}, | ||
# o1-mini | ||
"o1-mini-2024-09-12": {"in": 1.10 / 1_000_000, "out": 4.40 / 1_000_000}, | ||
"gemini-2.5-pro-preview-06-05": {"in": 0.15 / 1_000_000, "out": 3.50 / 1_000_000}, | ||
"gemini-2.5-pro-preview": {"in": 0.15 / 1_000_000, "out": 3.50 / 1_000_000}, | ||
"gemini-2.5-flash": {"in": 0.30 / 1_000_000, "out": 2.50 / 1_000_000}, | ||
"gemini-2.5-flash-lite-preview-06-17": {"in": 0.10 / 1_000_000, "out": 0.40 / 1_000_000}, | ||
"gemini-2.0-flash": {"in": 0.10 / 1_000_000, "out": 0.40 / 1_000_000}, | ||
"gemini-2.5-flash-preview-04-17": {"in": 0.15 / 1_000_000, "out": 0.60 / 1_000_000}, | ||
"gemini-2.0-flash-lite": {"in": 0.0075 / 1_000_000, "out": 0.30 / 1_000_000}, | ||
|
@@ -232,7 +239,10 @@ def gemini_model_call( | |
*, | ||
debug: bool = False, | ||
) -> Tuple[str, int | None, int | None]: | ||
client = genai.Client(api_key=os.getenv("GEMINI_API_KEY")) | ||
client = genai.Client( | ||
api_key=os.getenv("GEMINI_API_KEY"), | ||
# 5 minutes timeout per call | ||
http_options={"timeout": 5 * 60 * 1000}) | ||
Comment on lines
+242
to
+245
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default, the timeout was set to I've set a long timeout limit to fix those cases, and not cause timeout of valid requests. |
||
|
||
parts = [] | ||
for seg in segments: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extra comma made it an invalid json file