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

Add Get/Set logits functions to Python #956

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RyanUnderhill
Copy link
Member

Also fixes an issue with the ToPython function, arrays returned were all the same element due to the stride being set to zero. This calls the explicit constructor.

@@ -432,6 +443,8 @@ PYBIND11_MODULE(onnxruntime_genai, m) {
.def("is_done", &PyGenerator::IsDone)
.def("compute_logits", &PyGenerator::ComputeLogits)
.def("get_output", &PyGenerator::GetOutput)
.def("get_logits", &PyGenerator::GetLogits)
.def("set_logits", &PyGenerator::SetLogits)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do get_logits() and set_logits() work with float16 and float32 precision or only float32 precision?

@baijumeswani
Copy link
Contributor

baijumeswani commented Oct 7, 2024

Do we need the C/C++ equivalent functions? Could we also add a unit test?

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.

4 participants