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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KNN few shot fixes #1145

Merged
merged 5 commits into from
Jun 17, 2024
Merged

KNN few shot fixes #1145

merged 5 commits into from
Jun 17, 2024

Conversation

adam-simple
Copy link
Contributor

@adam-simple adam-simple commented Jun 13, 2024

  • Don't pass valset to bootstrap fewshot
  • forward_pass unpacks appropriately
  • few shot bootstrap args to pass through during forward pass

@adam-simple
Copy link
Contributor Author

adam-simple commented Jun 13, 2024

It might make sense to put a warning in the KNN call if **kwargs is empty. this can easily happen if someone calls .forward without keyword arguments, instead using args without keywords, like module.forward(input) or something. This currently would let KNN silently vectorize an empty list which will return some constant vector and so it will always return the same k likely irrelevant vectors.

@okhat
Copy link
Collaborator

okhat commented Jun 15, 2024

Thanks! Probably remove *args altogether then?

@okhat
Copy link
Collaborator

okhat commented Jun 15, 2024

tagging @adam-simple

@adam-simple
Copy link
Contributor Author

done

@arnavsinghvi11 arnavsinghvi11 merged commit 3c23b35 into stanfordnlp:main Jun 17, 2024
4 checks passed
@arnavsinghvi11
Copy link
Collaborator

Thanks @adam-simple !

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

3 participants