-
Notifications
You must be signed in to change notification settings - Fork 472
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
feat: find best embedding matches #1102
feat: find best embedding matches #1102
Conversation
Co-authored-by: Fangjun Kuang <[email protected]>
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.
Thanks! Left some minor comments. Otherwise, it looks good to me.
sherpa-onnx/c-api/c-api.h
Outdated
|
||
SHERPA_ONNX_API typedef struct | ||
SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult { | ||
SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch *matches; |
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.
SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch *matches; | |
const SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch *matches; |
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.
When using const there I get the following compile error
/Users/user/Documents/sherpa-rs/sys/sherpa-onnx/sherpa-onnx/c-api/c-api.cc:1275:30: error: read-only variable is not assignable
result->matches[i].score = matches[i].score;
~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/user/Documents/sherpa-rs/sys/sherpa-onnx/sherpa-onnx/c-api/c-api.cc:1281:29: error: read-only variable is not assignable
result->matches[i].name = name;
~~~~~~~~~~~~~~~~~~~~~~~ ^
I think we'll need to use internal non const in the function and case it to const before return
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.
Fixed in 7d2341d
Co-authored-by: Fangjun Kuang <[email protected]>
Co-authored-by: Fangjun Kuang <[email protected]>
Thank you for your first-time contribution! |
Resolve #1096