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: vector support #18

Merged
merged 114 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
0d10565
first version, without docstrings, tests and ruff
Dec 4, 2023
5d1671a
pydantic fix
Dec 4, 2023
b50f828
fix db __del__ hook
Dec 4, 2023
8b5179d
fix embedding type hint
Dec 4, 2023
f5e1665
sync
Dec 6, 2023
adf1517
fix: small fixes after developing clap plug
aaronabebe Dec 6, 2023
14d7882
Merge remote-tracking branch 'origin/feat/vector-support' into feat/v…
aaronabebe Dec 6, 2023
1cad65b
raise division by zero exception
Dec 8, 2023
aad6b42
remove postgres dependency
Dec 8, 2023
fed99ad
documentation
Dec 9, 2023
b1dddbb
embedding plugin wrapper rewrite untested
Dec 12, 2023
cd4923e
sync
Dec 13, 2023
2d1b9b5
sync
Dec 13, 2023
cb9974e
fix tests
Dec 13, 2023
860ce3c
fix: fix some bugs in embeddingplugins, change how __call__ in embedd…
aaronabebe Dec 15, 2023
e5e84e8
formatting
Dec 16, 2023
c2b8971
fix embedding plugin wrapper signatures
Dec 16, 2023
c23d50c
Merge remote-tracking branch 'origin/main' into feat/vector-support
aaronabebe Jan 2, 2024
232ae29
feat: add class for utility plugin type (e.g. textgen plugin)
aaronabebe Jan 3, 2024
54b1e4c
support length computation for mono tracks
Jan 6, 2024
8dc3167
Merge branch 'feat/vector-support' of github.com:okio-ai/nendo into f…
Jan 6, 2024
e8a5d39
update alembic.ini
Jan 6, 2024
7cc2267
sync
Jan 6, 2024
2a19be7
sync
Jan 6, 2024
bd39e6c
make embedding plugin optional in vector library
Jan 9, 2024
f11813d
make embedding plugin optional in vector library
Jan 9, 2024
b76036b
fix storage driver
Jan 10, 2024
54b5649
fix track.local()
Jan 10, 2024
eb90846
fix track.as_local() bug
Jan 11, 2024
140f6e7
fix track.as_local() bug
Jan 11, 2024
7c8eb91
add relate_to_track function
Jan 14, 2024
7995a61
fix object refreshing upon manipulation
Jan 16, 2024
0b104cd
alleged fix for the track deletion bug
Jan 16, 2024
ad5413f
revert
Jan 17, 2024
8a4b8ad
add filter_related_tracks method
Jan 17, 2024
01592a0
new meta structure
Jan 18, 2024
cef595b
add create_track() function
Jan 19, 2024
28f96b5
fix create_object() function
Jan 19, 2024
c27b7e3
export NendoResource
Jan 19, 2024
a274d09
fix related tracks query v1
Jan 19, 2024
6c083ac
replace librosa.load with audioread
Jan 19, 2024
4bf128c
fix libsndfile bug with .flac files
Jan 20, 2024
a15bf0e
revert related tracks change
Jan 20, 2024
79c6a0d
fix direction of relationships, once and for all
Jan 20, 2024
7688183
change dtype of audio signal
Jan 20, 2024
73433cd
change dtype of audio signal
Jan 20, 2024
c23e1f7
revert audioread change
Jan 20, 2024
74a9eb2
fix has_related_track()
Jan 21, 2024
07e8b7b
add user filtering to get_track()
Jan 21, 2024
4f3fb03
remove location from track creation
Jan 21, 2024
93df209
fix user_id passing for get_track() function
Jan 22, 2024
cf4bcb5
fix embedding extension
Jan 22, 2024
c23120f
change vectorextension to support limit and offset
Jan 23, 2024
7c76b04
extend similarity search to allow for filtering
Jan 23, 2024
5727078
re-enable tests
Jan 24, 2024
fa02087
formatting
Jan 24, 2024
6293775
formatting
Jan 24, 2024
6170dd2
change default track-to-text for embedding
Jan 25, 2024
96afcc9
fix replace_plugin_data bug
Jan 26, 2024
42aa287
improve plugin loading traceback
Jan 27, 2024
b037961
fix embedding plugin auto-detection
Jan 27, 2024
c6de6c6
refine embedding search
Jan 29, 2024
11ef29d
add ordering to collection view; add add_tracks_to_collection function
Jan 31, 2024
dfd95b5
add ordering by collection position
Feb 1, 2024
e7a103c
fix ordering
Feb 1, 2024
a48e1e1
fix: add commented out new plugin repos to prepare for release
aaronabebe Feb 2, 2024
4ac9672
add cache_ok=True for performance
Feb 2, 2024
7e150e3
Merge branch 'feat/vector-support' of github.com:okio-ai/nendo into f…
Feb 2, 2024
5175223
track remove fix
Feb 4, 2024
04d8026
track remove fix
Feb 4, 2024
14f2843
fix embedding text
Feb 4, 2024
2b6ad5e
similarity fix
Feb 5, 2024
72e9569
add option for returning slim tracks
Feb 6, 2024
218c2aa
get plugin data fix
Feb 7, 2024
721e8d4
plugin data user_id fix
Feb 8, 2024
f473d7f
add type filter to find_collections
Feb 8, 2024
cfac253
fix
Feb 8, 2024
d1b7c91
replace plugin data fix
Feb 10, 2024
a09f356
many fixes
Feb 10, 2024
ca3e8b2
lift sqlalchemy-json
Feb 10, 2024
1b08bcd
lift sqlalchemy version
Feb 10, 2024
db37071
small fix
Feb 11, 2024
4ba66a6
support collection tracks ordering
Feb 11, 2024
f3a91c7
fix: add special case for loading tracks from flac files
aaronabebe Feb 14, 2024
a658800
fix: remove last flac file change again, doesnt work
aaronabebe Feb 14, 2024
25a9357
make embedding plugin respect replace config
Feb 14, 2024
1cc107d
Merge branch 'feat/vector-support' of github.com:okio-ai/nendo into f…
Feb 14, 2024
1e2becd
collectionslim fix, Makefile changes, documentation
Feb 15, 2024
d713535
update documentation
Feb 15, 2024
c9133d7
update documentation
Feb 15, 2024
1d75b25
update docs
Feb 15, 2024
0260b8e
update changelog, consolidate function signatures
Feb 16, 2024
0fd81d1
formatting
Feb 16, 2024
feb4860
formatting
Feb 16, 2024
bafa7f1
fix tests
Feb 16, 2024
e2d299d
update docs
Feb 16, 2024
e27ed29
update platform docs
Feb 16, 2024
513aa06
add swagger API docs
Feb 16, 2024
3534757
added library_size() and collection_size() methods
Feb 17, 2024
bf25a82
get collection related_tracks fix
Feb 17, 2024
d9da44e
lift ruff; update README
Feb 20, 2024
f4a9350
update README
Feb 20, 2024
dbc7a69
update README
Feb 20, 2024
507e095
update README
Feb 20, 2024
4c0e0e3
add embedding plugin dev docs
Feb 20, 2024
89b32ea
fix docs nav
Feb 20, 2024
80903cf
update docs
Feb 20, 2024
4533276
update docs
Feb 20, 2024
54bcbd5
update
Feb 21, 2024
0f3e751
update ruff config
Feb 21, 2024
c6d1770
update README
Feb 21, 2024
73428fa
update docs
Feb 21, 2024
c499746
update discord link
Feb 21, 2024
6681e92
fix test pipeline
Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
# key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ matrix.pydantic-version }}-${{ hashFiles('pyproject.toml') }}-test-v06
- name: Install OS Dependencies
# if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get install -y libsndfile1-dev libportaudio2 ffmpeg
run: sudo apt-get update && sudo apt-get install -y libsndfile1-dev libportaudio2 ffmpeg
- name: Install Dependencies
# if: steps.cache.outputs.cache-hit != 'true'
run: make setup-test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ tests/tests/
# docs
htmlcov/
plugindocs/
platformdocs/

# nendo library
nendo_library/
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,42 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

<!-- insertion marker -->
## [0.2.0](https://github.com/okio-ai/nendo/releases/tag/0.2.0) - 2024-02-19

- Added the first extension for the Nendo Library: The `NendoLibraryVectorExtension` is a mix-in class that can be used by implementations of the Nendo Library to add support for saving and retrieving embedding vectors.
- Added a new class `NendoEmbedding` that represents an embedding of a `NendoTrack` and stores the vector together with the ID of the track from which it was computed, the text representation of the track that was used to compute the embedding, as well as the embedding plugin's name and version that were used to compute the embedding.
- Added a new subclass of the `NendoPlugin` called `EmbeddingPlugin` that accepts either a `NendoTrack`, a `NendoCollection`, a `signal` and a `text`, or only a `text` and computes corresponding `NendoEmbedding`(s), depending on whether a single object or a `NendoCollection` was provided. It also determines whether the currently used `NendoLibrary` implementation uses the `NendoLibraryVectorExtension` and, if so, saves the computed embeddings directly to the library.
- Fixed a problem with the way dictionaries (like `NendoTrack.meta` and `NendoTrack.resource`) were stored in the Nendo Library which resulted in them being stored as JSON strings instead of JSON dictionaries. **This means that upgrading Nendo will break any apps that use libraries that were created with previous versions of nendo.** Please make sure you understand the implications and either flush your DB or convert it to match the new data model.
- Added the global configuration variable `replace_plugin_data`, that specifies whether new plugin data will overwrite existing plugin data for the specific plugin name and version used to generate the data.
- Reworked the way relationships between tracks are managed. Previously, Nendo would create bidirectional relationships, which caused problems with the retrieval of related tracks, especially when using paging (i.e. `offset` and `limit`). The new approach is to only store relationships _from_ a derivative track _to_ the original track from which it was derived. Accordingly, all functions for retrieving related tracks accept a new parameter, `direction: str`, which can assume either one of the values `"to"`, `"from"` and `"both"` and will change their retrieval behavior accordingly. Also, the method names for some methods were changed to reflect the new semantics more accurrately: `NendoTrack.has_relationship_to()` was replaced by `NendoTrack.has_related_track(direction=...)`. `collection.has_relationship_to()` was replaced by `collection.has_related_collection()`.
- Added a new shortcut function `NendoTrack.relate_to_track()` that creates a relationship of the specified `relationship_type` and with the specified metadata from the given track _to_ another track.
- Fixed a bug where the length of a `NendoTrack` would not be correctly determined if the track had a mono signal.
- Two new shortcut functions `NendoTrack.refresh()` and `collection.refresh()` were added that retrieve the latest version of the given object as it exists in the Nendo Library, effectively allowing to quickly pull the latest changes to an object from the database.
- The `NendoTrack.get_plugin_data()` methods signature was extended to allow for filtering a track's plugin data also by `plugin_version` and `user_id` in addition to the existing filters.
- Adjusted the `add_track()` function:
- Stores all the ID3 metadata in `NendoTrack.meta` instead of `NendoTrack.resource.meta`.
- If no ID3 metadata was found `NendoTrack.meta.title` will be set to the original name of the imported file.
- Added the `load_related_tracks: bool = False` flag to the `NendoLibrary.get_tracks()` function that allows to enable/disable the populating of the `NendoTrack.related_tracks` field upon retrieval of many tracks from the Nendo Library. This optimizes the performance of the call and allows to retrieve smaller objects that are more suitable for network transmission in web applications that use Nendo Core.
- Add support for `NendoLibrary.filter_tracks(collection_id="...", order_by="collection")` that allows to order of the retrieved tracks by their `relationship_position` in the referenced collection.
- Added the `NendoLibrary.filter_related_tracks()` method to allow for filtering of related tracks queries.
- Changed the `NendoLibrary.filter_tracks()` method to search over `NendoTrack.meta` in addition to `NendoTrack.resource`. Changed the name of the `resource_filters` argument to `search_meta` to reflect the new behavior.
- Added the `NendoLibrary.add_tracks_to_collection()` function to allow for multiple tracks given as a list of IDs to be added to the specified collection.
- Added the `order` parameter to the `NendoLibrary.get_collection_tracks()` function to allow for control of the ordering. Defaults to `"asc"`, which will order the collection's tracks in ascending order of their `relationship_position`.
- Changed the signature and behavior of the `get_collection()` function:
- Renamed the `details` parameter to `get_related_tracks` to better reflect it's effect on the function. The parameter controls whether the `NendoCollection.related_tracks` field will be populated.
- The function now always returns a `NendoCollection` instead of returning a `NendoCollectionSlim` if `details=False` as is was previously.
- Added the `user_id` parameter to the following functions:
- `NendoTrack.local()`
- `NendoTrack.get_plugin_value()`
- `NendoLibrary.get_track()`
- `NendoLibrary.remove_collection()`
- Changed the signature of the `NendoLibrary.add_plugin_data()` function to make specifying of the `plugin_version` optional. If none is given, version will be inferred from the currently registered version of the plugin.
- Extended the signature of the `NendoLibrary.filter_collections()` function by the `collection_types` parameter to also allow for filtering by a list of collection types.
- Added the `NendoLibrary.library_size()` and `NendoLirary.collection_size()` functions to get the number of tracks in the library per user and the number of tracks in a collection, respectively.
- A bunch of small bugfixes, too many to mention them all here.

<small>[Compare with 0.1.3](https://github.com/okio-ai/nendo/compare/0.1.3...0.2.0)</small>

## [0.1.3](https://github.com/okio-ai/nendo/releases/tag/0.1.3) - 2023-12-08

<small>[Compare with 0.1.2](https://github.com/okio-ai/nendo/compare/0.1.2...0.1.3)</small>
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ It's super easy to get started with the nendo development environment. Just make
make setup
```

> **Note**
> **Note**:
> Developing for and with Nendo Core requires careful dependency management. The use of a [python virtual environment](https://docs.python.org/3/library/venv.html) like [pyenv](https://github.com/pyenv/pyenv) or [poetry](https://python-poetry.org/) is highly recommended.

## Development process
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ FORMAT_CMD = python3 -m ruff --fix-only src tests ; black ./src
CHECK_CMD = python3 -m ruff check src tests
TEST_CMD = python -m coverage run -m pytest tests/*.py && python -m coverage report && python -m coverage html
ORM_CMD = alembic revision --autogenerate -m "Autogenerated model update"
DOCS_CMD = mkdir -p htmlcov/ && touch htmlcov/index.html && mkdir -p docs/.overrides && python3 ./scripts/gen_plugin_docs.py && mkdocs build -vs
DOCS_SERVE_CMD = mkdir -p htmlcov/ && touch htmlcov/index.html && mkdir -p docs/.overrides && python3 ./scripts/gen_plugin_docs.py && mkdocs serve -s
ORM_UPGRADE_CMD = alembic upgrade heads
DOCS_CMD = mkdir -p htmlcov/ && touch htmlcov/index.html && mkdir -p docs/.overrides && python3 ./scripts/gen_plugin_docs.py && python3 ./scripts/gen_platform_docs.py && mkdocs build -vs
DOCS_SERVE_CMD = mkdir -p htmlcov/ && touch htmlcov/index.html && mkdir -p docs/.overrides && python3 ./scripts/gen_plugin_docs.py && python3 ./scripts/gen_platform_docs.py && mkdocs serve -s
POETRY_SETUP_CMD = poetry install --all-extras --sync
POETRY_PUBLISH_CMD = poetry build && poetry publish
CHANGELOG_CMD = git-changelog -c angular -t keepachangelog -s build,deps,feat,fix,refactor,docs -i -o CHANGELOG.md -T --bump=auto .
RELEASE_CMD = git add pyproject.toml CHANGELOG.md && git commit -m "chore: prepare release $(version)" && git tag $(version) && git push && git push --tags

.PHONY: setup setup-test setup-poetry clean format check test docs orm changelog publish release
.PHONY: setup setup-test setup-poetry clean format check test docs orm orm-upgrade changelog publish release

# Default target
all: format check test orm build-docs
Expand Down Expand Up @@ -57,6 +58,9 @@ orm:
exit 0; \
fi

orm-upgrade:
@$(ORM_UPGRADE_CMD)

changelog:
@$(CHANGELOG_CMD)

Expand All @@ -68,4 +72,4 @@ release:
@$(RELEASE_CMD)

publish:
@$(POETRY_PUBLISH_CMD)
@$(POETRY_PUBLISH_CMD)
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<p align="center">
<a href="https://okio.ai" target="_blank">
<img src="https://img.shields.io/website/https/nendo.ai" alt="Documentation">
<img src="https://img.shields.io/website/https/okio.ai" alt="Website">
</a>
<a href="https://github.com/okio-ai/nendo/actions/workflows/test.yml" target="_blank">
<img src="https://github.com/okio-ai/nendo/actions/workflows/test.yml/badge.svg" alt="Test">
Expand All @@ -35,11 +35,11 @@

---

**Website**: <a href="https://okio.ai/" target="_blank">https://okio.ai/</a>
**Website**: <a href="https://okio.ai/" target="_blank">okio.ai</a>

**Documentation**: <a href="https://okio.ai/docs" target="_blank">https://okio.ai/docs/</a>
**Documentation**: <a href="https://okio.ai/docs" target="_blank">okio.ai/docs</a>

**Source Code**: <a href="https://github.com/okio-ai/nendo" target="_blank">https://github.com/okio-ai/nendo</a>
**Nendo Platform**: <a href="https://github.com/okio-ai/Nendo-Platform" target="_blank">Repository</a>

---

Expand All @@ -53,6 +53,7 @@ Nendo core is the AI audio tool suite allowing you to effortlessly develop audio
- Integrated essentials for audio processing and library management.
- An extensible plugin architecture and growing ecosystem of AI Audio plugins.
- Easily combinable tools that together address a wide range of use cases.
- Support for storing, managing and retrieving embedding vectors.

## Requirements

Expand Down Expand Up @@ -84,7 +85,7 @@ from nendo import Nendo
nendo = Nendo()
```

... and just like that, you're ready to go!
... and just like that, you're ready to go! Now, there are multiple ways to configure Nendo, refer to the [relevant documentation pages](https://okio.ai/docs/usage/config/) for more information.

## Usage

Expand Down
4 changes: 3 additions & 1 deletion alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ prepend_sys_path = .
# version_path_separator = :
# version_path_separator = ;
# version_path_separator = space
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
version_path_separator = os

version_locations = %(here)s/alembic/versions

# set to 'true' to search source files recursively
# in each "version_locations" directory
Expand Down
13 changes: 4 additions & 9 deletions docs/development/analysisplugindev.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,17 @@ class DestructionAnalyzer(NendoAnalysisPlugin):
return {"destroyed": "yes"}

@NendoAnalysisPlugin.run_track
def is_fucked_up(self, track: NendoTrack, use_full_analysis: bool = True):
def is_destroyed(self, track: NendoTrack, use_full_analysis: bool = True):
if use_full_analysis:
self.analyze_devo_ness(track)
self.analyze_destruction(track)
```

The basics are very simple: Make sure to extend `NendoAnalysisPlugin`, and make sure that your extended class has at
least
one method that is decorated with `@NendoAnalysisPlugin.run_track` or `@NendoAnalysisPlugin.run_collection`.
If you used the official setup script, these steps are already taken care of.
The basics are very simple: Make sure to extend `NendoAnalysisPlugin`, and make sure that your extended class has at least one method that is decorated with `@NendoAnalysisPlugin.run_track` or `@NendoAnalysisPlugin.run_collection`. If you used the official setup script, these steps are already taken care of.

Then your plugin can have a few different methods that do the concrete metadata extraction and addition to
the `NendoTrack`.
These need to be decorated with `@NendoAnalysisPlugin.plugin_data`.
Then your plugin can have a few different methods that do the concrete metadata extraction and addition to the `NendoTrack`. These need to be decorated with `@NendoAnalysisPlugin.plugin_data`.

#### NendoAnalysis.plugin_data
#### NendoAnalysisPlugin.plugin_data

This decorator automatically adds all calculated metadata to the `NendoTrack`'s `List[PluginData]`.
To learn more about `NendoTrack` or `PluginData` check out the API reference.
Expand Down
129 changes: 129 additions & 0 deletions docs/development/embeddingplugindev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Writing an `EmbeddingPlugin`

We'll go step by step through all the files you need to create and what they'll do.

Remember the directory structure from before:

```shell
├── README.md
├── pyproject.toml
├── setup.py
├── src
│   └── nendo_plugin_embed_text
│   ├── __init__.py
│   ├── config.py
│   └── plugin.py
```

Let's look into the different files now.

## Files

### plugin.py

The most important file in your plugin. It is where the main plugin call code resides Let's go through it step by step.

```python
from logging import Logger
from my_embedding_model import MyModel
from nendo import Nendo, NendoConfig, NendoEmbeddingPlugin, NendoTrack
import numpy.typing as npt

from .config import EmbedTextConfig

settings = EmbedTextConfig()

class TextEmbedder(NendoEmbeddingPlugin):
"""Find out how weird your music is."""
nendo_instance: Nendo = None
config: NendoConfig = None
logger: Logger = None
model: MyModel = None
device: str = None

def __init__(self, **data: Any):
"""Initialize the plugin."""
super().__init__(**data)
self.model = MyModel.from_pretrained(settings.model).to(self.device)

def track_to_text(self, track: NendoTrack) -> str:
"""Convert track to text."""
text = ""
for pd in track.get_plugin_data():
text += f"{pd.key}: {pd.value}; "
return text

@NendoEmbeddingPlugin.run_track
def embed_track(
self,
track: NendoTrack,
) -> Tuple[str, npt.NDArray]:
text_representation = self.track_to_text(track)
return (
text_representation,
self.model.embed_text(text_representation)
)
```

The basics are very simple: Extend `NendoEmbeddingPlugin`, and make sure that your class has at least one method that is decorated with `@NendoEmbeddingPlugin.run_track`, `@NendoEmbeddingPlugin.run_collection`, `@NendoEmbeddingPlugin.run_signal_and_text` or `@NendoEmbeddingPlugin.run_text`.

#### NendoEmbeddingPlugin.run_track

The function receives the argument `track: NendoTrack` and returns a `Tuple` containing the embedded text as a string and the embedding as a `numpy.types.NDArray`.

#### NendoEmbeddingPlugin.run_collection

The function receives the argument `collection: NendoCollection` and returns a `Tuple` containing the embedded text as a string and the embedding as a `numpy.types.NDArray`.

#### NendoEmbeddingPlugin.run_signal_and_text

The function receives the arguments `signal: str` and `text: str` and returns a `Tuple` containing the embedded text as a string and the embedding as a `numpy.types.NDArray`.

#### NendoEmbeddingPlugin.run_text

The function receives the argument `text: str` and returns a `Tuple` containing the embedded text as a string and the embedding as a `numpy.types.NDArray`.

### config.py

```python
from nendo import NendoConfig


class EmbeddingTextConfig(NendoConfig):
"""Configuration defaults for the text embedding plugin."""
model_config = ConfigDict(arbitrary_types_allowed=True)

my_default_param: bool = False
```

This class extends the base `NendoConfig` and allows you to define some default and overridable parameters for your plugin.
It behaves just like `NendoConfig`, read up more on basic `nendo` configuration [here](../usage/config.md).

### setup.py

```python
from distutils.core import setup

if __name__ == "__main__":
setup(
name="nendo-plugin-embed-text",
version="0.1.0",
description="Nendo text embedding plugin",
author="Author Name <[email protected]>",
)
```

This is a standard `setup.py` file. You can read up more on how to configure it [in the python packaging docs](https://packaging.python.org/tutorials/packaging-projects/). You just need to define some basics like the name of your plugin, a version number and a description.
Make sure to specify the same version in `src/nendo_plugin_embed_text/__init__.py` and in `pyproject.toml`.

### pyproject.toml

All nendo plugins use `pyproject.toml` to manage their dependencies.
You can read up more on how to configure it [here](https://packaging.python.org/tutorials/packaging-projects/).

## Finished plugin

That's it!

!!! success
When you're finished go back to the plugin development [overview](plugindev.md#running-a-plugin) and learn how to test and publish your plugin.
9 changes: 9 additions & 0 deletions docs/development/plugindev.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ In nendo we currently differentiate between four types of plugins.

- [nendo_plugin_fx_core](https://github.com/okio-ai/nendo_plugin_fx_core)

=== "Embedding Plugins"

Plugins that compute vector embeddings of `NendoTrack`s are called embedding plugins.
They take either a track's signal or first create a text representation from it or take both and then embed it into a vector space. The resulting embeddings can be used for further processing, sampling, similarity search, etc.

Examples:

- [nendo_plugin_embed_clap](https://github.com/okio-ai/nendo_plugin_embed_clap)

=== "Library Plugins"

!!! warning
Expand Down
21 changes: 21 additions & 0 deletions docs/platform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Nendo Platform

Nendo Platform is the feature-rich web application stack to develop and run new GUI-enabled tools that are based on Nendo Core and it's plugin ecosystem.

## Requirements

To run Nendo Platform, make sure you have `docker` and `docker-compose` (`>=1.28.0`) installed.

!!! info "Operating System Requirements"
Currently, Linux is the only operating system that is officially supported by Nendo Platform. Feel free to try and run it on Mac OSX or Windows but expect certain Features to fail without significant modifications to its codebase.

!!! info "GPU Requirements"
Nendo Platform needs a GPU with at least 24 GB of VRAM for all of its features to work properly. If your system does not have a GPU available, you can still run Nendo Platform in [CPU mode](platform/usage.md#cpu-only-mode) but expect certain tools to fail.

Visit the following pages to learn more about how to run and use Nendo Platform:

- [:octicons-arrow-right-24: Get Started](platform/usage.md)
- [:octicons-arrow-right-24: Configuration Guide](platform/config.md)
- [:octicons-arrow-right-24: Development Guide](platform/development.md)
- [:octicons-arrow-right-24: Learn about the Nendo Platform API Server](platform/server/index.md)
- [:octicons-arrow-right-24: Learn about the Nendo Platform Web Frontend](platform/web/index.md)
Loading
Loading