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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nits #1308

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Nits #1308

wants to merge 3 commits into from

Conversation

mrzu
Copy link

@mrzu mrzu commented Jul 7, 2023

While I was reading some of OpenAI code and documents, I noticed little typos/bugs. In my view, only the first of the three listed merits further scrutiny, as it appears the code may not align with the author's original intention. This is not an actual pull request.

1. eval_sample(self, sample: Any, *_)

Commit: Code flow nit in translate eval

Case when expected is None

In the case when expected is None, the code (line 45):

if isinstance(expected, tuple):
    expected = list(expected)
elif not isinstance(expected, list):
    expected = [expected]

Will have expected to hold [None] (a list with a single value None)

The code later checks if expected is not None (line 57) which will always be true, which I don't think was the intended behavior.

Case when score is None

When the score is evaluated by (line 58):

score = self.bleu.sentence_score(sampled, expected).score

If score is None, the line match = score > 30 (line 61) will produce the exception TypeError: '>' not supported between instances of 'NoneType' and 'int' and the following check score is not None (line 63) will never be reached.

2. find_top_k_closest_embeddings

Commit Factor the normalization in cosine similarity fn
Really a nit here, this is not a performance issue in practical terms. The normalization of the two input vectors can be combined.

3. Typo in the post Introducing Triton: Open-source GPU programming for neural networks

The section "Fused softmax with the Torch JIT.", provides the following code:

@torch.jit.script
def softmax(x):
    x_max = x.max(dim=1)[0]
    z = x - x_max[:, None]
    numerator = torch.exp(x)
    denominator = numerator.sum(dim=1)
    return numerator / denominator[:, None]

I believe numerator = torch.exp(x) should be numerator = torch.exp(z) (i.e. z not x)

Final checklist 馃憖

Submission agreement

By contributing to Evals, you are agreeing to make your evaluation logic and data under the same MIT license as this repository. You must have adequate rights to upload any data used in an Eval. OpenAI reserves the right to use this data in future service improvements to our product. Contributions to OpenAI Evals will be subject to our usual Usage Policies (https://platform.openai.com/docs/usage-policies).

  • I agree that my submission will be made available under an MIT license and complies with OpenAI's usage policies.

Email address validation

If your submission is accepted, we will be granting GPT-4 access to a limited number of contributors. Access will be given to the email address associated with the commits on the merged pull request.

  • I acknowledge that GPT-4 access will only be granted, if applicable, to the email address used for my merged pull request.

Limited availability acknowledgment

We know that you might be excited to contribute to OpenAI's mission, help improve our models, and gain access to GPT-4. However, due to the requirements mentioned above and the high volume of submissions, we will not be able to accept all submissions and thus not grant everyone who opens a PR GPT-4 access. We know this is disappointing, but we hope to set the right expectation before you open this PR.

  • I understand that opening a PR, even if it meets the requirements above, does not guarantee the PR will be merged nor GPT-4 access be granted.

Submit eval

  • I have filled out all required fields of this form
  • I have used Git LFS for the Eval JSON data
  • (Ignore if not submitting code) I have run pip install pre-commit; pre-commit install and have verified that black, isort, and autoflake are running when I commit and push

Failure to fill out all required fields will result in the PR being closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant