From 004808044f7f1157bab111abfac90ed05996a513 Mon Sep 17 00:00:00 2001 From: Andantei Date: Mon, 27 Feb 2023 16:54:54 -0800 Subject: [PATCH] update to the latest plugin format --- plugin.py | 7 +++---- requirements.txt | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/plugin.py b/plugin.py index ce91b19..689d05c 100644 --- a/plugin.py +++ b/plugin.py @@ -1,9 +1,8 @@ -from tuneflow_py import TuneflowPlugin, ParamDescriptor, Song, ReadAPIs, TrackType, WidgetType, LabelText +from tuneflow_py import TuneflowPlugin, ParamDescriptor, Song, TrackType, WidgetType, LabelText from typing import Dict, Any from audioldm import text_to_audio, build_model from pathlib import Path import traceback -import random from io import BytesIO import soundfile as sf from typing import List @@ -26,7 +25,7 @@ def provider_display_name() -> LabelText: } @staticmethod - def params(song: Song, read_apis: ReadAPIs) -> Dict[str, ParamDescriptor]: + def params(song: Song) -> Dict[str, ParamDescriptor]: return { "prompt": { "displayName": { @@ -105,7 +104,7 @@ def params(song: Song, read_apis: ReadAPIs) -> Dict[str, ParamDescriptor]: } @staticmethod - def run(song: Song, params: Dict[str, Any], read_apis: ReadAPIs): + def run(song: Song, params: Dict[str, Any]): model_path = str(Path(__file__).parent.joinpath('ckpt/ldm_trimmed.ckpt').absolute()) model = build_model(ckpt_path=model_path) # TODO: Support prompt i18n diff --git a/requirements.txt b/requirements.txt index 7bc34b2..19ab0ad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,4 @@ pandas torchlibrosa==0.0.9 transformers ftfy -tuneflow-py>=0.1.2 \ No newline at end of file +tuneflow-py>=0.3.0 \ No newline at end of file