Fix formatting/typing so pre-commit hooks pass #1451
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Not an eval)
One-line summary: Pre-commit hooks were failing. I identified the main cause, and then fixed all secondary pre-commit issues. I only changed the logic in one place,
oiaevalset.py
.I was having issues with type-hinting and identified that the old
typings
directory was causing thefrom openai import OpenAI
import to register as an error. I decided to go through and fix all the issues that appeared inpre-commit run --all-files
.NOTE:
oaievalset.py
by adding acontinue
statement if aneval
oreval.key
was missing.eval
andeval.key
are notNone
but forcing an error here doesn't match what I interpret as intended behavior.The manual work involved was mainly:
typings
directory, which was interfering withopenai
type-hints (such asfrom openai import OpenAI
)oaievalset.py
.client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
line below all the imports.Thus this PR is broken into three parts:
typings
(first commit)