-
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?
Conversation
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 |
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.
Similar to the Claudette client, azure client/endpoint is needed only when running OpenAI, so it's optional
client = genai.Client( | ||
api_key=os.getenv("GEMINI_API_KEY"), | ||
# 5 minutes timeout per call | ||
http_options={"timeout": 5 * 60 * 1000}) |
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.
By default, the timeout was set to None
. This caused some bad requests to never fail, and block the eval loop.
I've set a long timeout limit to fix those cases, and not cause timeout of valid requests.
"hotpotqa": "Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{context}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {input}\nAnswer:", | ||
"2wikimqa": "Answer the question based on the given passages. Only give me the answer and do not output any other words.\n\nThe following are given passages.\n{context}\n\nAnswer the question based on the given passages. Only give me the answer and do not output any other words.\n\nQuestion: {input}\nAnswer:", | ||
"triviaqa": "Answer the question based on the given passage. Only give me the answer and do not output any other words. The following are some examples.\n\n{context}\n\n{input}", | ||
"triviaqa": "Answer the question based on the given passage. Only give me the answer and do not output any other words. The following are some examples.\n\n{context}\n\n{input}" |
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
Bunch of small things:
huggingface-cli
command downloads the dataset to the current folder, as expected in the rest of the codebaserun_eval.py
fails otherwise