Skip to content

Commit

Permalink
update to the latest plugin format
Browse files Browse the repository at this point in the history
  • Loading branch information
andantei committed Feb 28, 2023
1 parent 2316ef7 commit 0048080
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions plugin.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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": {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ pandas
torchlibrosa==0.0.9
transformers
ftfy
tuneflow-py>=0.1.2
tuneflow-py>=0.3.0

0 comments on commit 0048080

Please sign in to comment.