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

feat: find best embedding matches #1102

Merged

Conversation

thewh1teagle
Copy link
Contributor

Resolve #1096

Copy link
Collaborator

@csukuangfj csukuangfj left a 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_API typedef struct
SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult {
SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch *matches;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch *matches;
const SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch *matches;

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 7d2341d

sherpa-onnx/csrc/speaker-embedding-manager.cc Show resolved Hide resolved
@csukuangfj
Copy link
Collaborator

Thank you for your first-time contribution!

@csukuangfj csukuangfj merged commit c0eaf86 into k2-fsa:master Jul 11, 2024
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.

max speakers for speaker embedding manager
2 participants