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/embeddings plugins #240

Merged
merged 3 commits into from
Jul 20, 2024
Merged

feat/embeddings plugins #240

merged 3 commits into from
Jul 20, 2024

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Jul 20, 2024

example usage:
https://github.com/TigreGotico/ovos-face-embeddings-plugin
https://github.com/TigreGotico/ovos-voice-embeddings-plugin
https://github.com/TigreGotico/ovos-chromadb-embeddings-plugin
https://github.com/TigreGotico/ovos-gguf-embeddings-plugin

Summary by CodeRabbit

  • New Features

    • Introduced a structured approach for managing embeddings across text, voice, and face modalities.
    • Added functions to find and load various types of embeddings plugins, enhancing discoverability and flexibility.
    • Established abstract classes for text, face, and voice embeddings, allowing for customizable storage and retrieval methods.
    • Expanded plugin types and configuration constants to better categorize embedding functionalities.
  • Bug Fixes

    • Improved the efficiency and resource management of plugin loading and instantiation.

@JarbasAl JarbasAl added the enhancement New feature or request label Jul 20, 2024
Copy link
Contributor

coderabbitai bot commented Jul 20, 2024

Walkthrough

The changes enhance the ovos_plugin_manager module by establishing a comprehensive framework for managing embeddings across text, voice, and face modalities. New functionalities enable the discovery and loading of plugins, while a well-defined approach to embedding management fosters extensibility and integration with future enhancements.

Changes

Files Change Summary
ovos_plugin_manager/embeddings.py Introduced functions for finding and loading embeddings plugins for text, voice, and face.
ovos_plugin_manager/templates/embeddings.py Defined an abstract class for embeddings and specific classes for managing text, voice, and face embeddings, with relevant methods.
ovos_plugin_manager/utils/__init__.py Added new constants for plugin types and configuration types related to embeddings.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PluginManager
    participant EmbeddingPlugin

    User->>PluginManager: find_embeddings_plugins()
    PluginManager-->>User: List of available plugins
    User->>PluginManager: load_embeddings_plugin(plugin_name)
    PluginManager->>EmbeddingPlugin: Instantiate plugin class
    EmbeddingPlugin-->>User: Ready to use plugin
Loading

🐇 In a world of embeddings, I hop with glee,
New plugins to play with, oh what fun for me!
Text, voice, and faces, all ready to blend,
With each little tweak, new magic we send.
Let's bounce through the code, make it all sing,
In the garden of plugins, joy is the spring! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JarbasAl JarbasAl marked this pull request as ready for review July 20, 2024 00:17
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fbab381 and 06c91fb.

Files selected for processing (3)
  • ovos_plugin_manager/embeddings.py (1 hunks)
  • ovos_plugin_manager/templates/embeddings.py (1 hunks)
  • ovos_plugin_manager/utils/init.py (2 hunks)
Additional comments not posted (13)
ovos_plugin_manager/embeddings.py (8)

5-11: LGTM!

The function correctly finds all installed embedding plugins using the find_plugins utility function.


14-21: LGTM!

The function correctly loads an embedding plugin using the load_plugin utility function.


24-30: LGTM!

The function correctly finds all installed voice embedding plugins using the find_plugins utility function.


33-40: LGTM!

The function correctly loads a voice embedding plugin using the load_plugin utility function.


43-49: LGTM!

The function correctly finds all installed face embedding plugins using the find_plugins utility function.


52-59: LGTM!

The function correctly loads a face embedding plugin using the load_plugin utility function.


62-68: LGTM!

The function correctly finds all installed text embedding plugins using the find_plugins utility function.


71-78: LGTM!

The function correctly loads a text embedding plugin using the load_plugin utility function.

ovos_plugin_manager/templates/embeddings.py (3)

7-40: LGTM!

The class EmbeddingsDB is well-structured and correctly follows the abstract base class pattern. The distance method is implemented correctly to calculate cosine distance between two embeddings.


64-100: LGTM!

The class FaceEmbeddingsRecognizer is well-structured and correctly uses the base class methods. The predict method is implemented correctly to return the top face match based on the threshold.


103-149: LGTM!

The class VoiceEmbeddingsRecognizer is well-structured and correctly uses the base class methods. The predict method is implemented correctly to return the top voice match based on the threshold.

ovos_plugin_manager/utils/__init__.py (2)

25-28: LGTM!

The new constants for various embedding types are appropriately added to the PluginTypes class and follow the existing pattern.


66-69: LGTM!

The new constants for various embedding configuration types are appropriately added to the PluginConfigTypes class and follow the existing pattern.

ovos_plugin_manager/templates/embeddings.py Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 06c91fb and 3503d9b.

Files selected for processing (2)
  • ovos_plugin_manager/embeddings.py (1 hunks)
  • ovos_plugin_manager/templates/embeddings.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • ovos_plugin_manager/embeddings.py

ovos_plugin_manager/templates/embeddings.py Outdated Show resolved Hide resolved
ovos_plugin_manager/templates/embeddings.py Outdated Show resolved Hide resolved
ovos_plugin_manager/templates/embeddings.py Outdated Show resolved Hide resolved
ovos_plugin_manager/templates/embeddings.py Outdated Show resolved Hide resolved
ovos_plugin_manager/templates/embeddings.py Outdated Show resolved Hide resolved
ovos_plugin_manager/templates/embeddings.py Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3503d9b and 0ca7a6b.

Files selected for processing (1)
  • ovos_plugin_manager/templates/embeddings.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • ovos_plugin_manager/templates/embeddings.py

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0ca7a6b and a4c6493.

Files selected for processing (3)
  • ovos_plugin_manager/embeddings.py (1 hunks)
  • ovos_plugin_manager/templates/embeddings.py (1 hunks)
  • ovos_plugin_manager/utils/init.py (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • ovos_plugin_manager/embeddings.py
  • ovos_plugin_manager/templates/embeddings.py
Additional comments not posted (2)
ovos_plugin_manager/utils/__init__.py (2)

25-28: LGTM! New constants for embeddings are correctly added.

The new constants for EMBEDDINGS, FACE_EMBEDDINGS, VOICE_EMBEDDINGS, and TEXT_EMBEDDINGS follow the existing pattern and are correctly defined.


66-69: LGTM! New constants for embeddings configurations are correctly added.

The new constants for EMBEDDINGS, FACE_EMBEDDINGS, VOICE_EMBEDDINGS, and TEXT_EMBEDDINGS configurations follow the existing pattern and are correctly defined.

Copy link

codecov bot commented Jul 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 232 lines in your changes missing coverage. Please review.

Please upload report for BASE (dev@fee4483). Learn more about missing BASE report.

Files Patch % Lines
ovos_plugin_manager/templates/embeddings.py 0.00% 198 Missing ⚠️
ovos_plugin_manager/embeddings.py 0.00% 26 Missing ⚠️
ovos_plugin_manager/utils/__init__.py 0.00% 8 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             dev    #240   +/-   ##
=====================================
  Coverage       ?   0.00%           
=====================================
  Files          ?      60           
  Lines          ?    4670           
  Branches       ?       0           
=====================================
  Hits           ?       0           
  Misses         ?    4670           
  Partials       ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a4c6493 and 5452d89.

Files selected for processing (1)
  • ovos_plugin_manager/templates/embeddings.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • ovos_plugin_manager/templates/embeddings.py

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5452d89 and a88d5cc.

Files selected for processing (1)
  • ovos_plugin_manager/templates/embeddings.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • ovos_plugin_manager/templates/embeddings.py

@JarbasAl JarbasAl merged commit 95766b2 into OpenVoiceOS:dev Jul 20, 2024
8 checks passed
@github-actions github-actions bot mentioned this pull request Sep 2, 2024
@coderabbitai coderabbitai bot mentioned this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant