From 42082ff3544c4f64514a3aceeb52036ecda92693 Mon Sep 17 00:00:00 2001 From: Malar Kannan Date: Thu, 25 Feb 2021 11:31:40 +0530 Subject: [PATCH] fix setup.py namespace package issue --- plume/utils/align.py | 34 ---------------------------------- setup.py | 6 +++--- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/plume/utils/align.py b/plume/utils/align.py index 5c9c74c..943676b 100644 --- a/plume/utils/align.py +++ b/plume/utils/align.py @@ -58,40 +58,6 @@ def tts_jupyter(): display.display(seg) -@app.command() -def cut(audio_path: Path, transcript_path: Path, out_dir: Path = "/tmp"): - from . import ExtendedPath - import datetime - import re - - aud_seg = pydub.AudioSegment.from_file(audio_path) - aud_seg[: 15 * 60 * 1000].export(out_dir / Path("audio.mp3"), format="mp3") - tscript_json = ExtendedPath(transcript_path).read_json() - - def time_to_msecs(time_str): - return ( - datetime.datetime.strptime(time_str, "%H:%M:%S,%f") - - datetime.datetime(1900, 1, 1) - ).total_seconds() * 1000 - - tscript_words = [] - broken = False - for m in tscript_json["monologues"]: - # tscript_words.append("|") - for e in m["elements"]: - if e["type"] == "text": - text = e["value"] - text = re.sub(r"\[.*\]", "", text) - text = re.sub(r"\(.*\)", "", text) - tscript_words.append(text) - if "timestamp" in e and time_to_msecs(e["timestamp"]) >= 15 * 60 * 1000: - broken = True - break - if broken: - break - (out_dir / Path("words.txt")).write_text("".join(tscript_words)) - - @app.command() def gentle_preview( audio_path: Path, diff --git a/setup.py b/setup.py index b5d756f..eac5e4b 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, find_packages +from setuptools import setup, find_namespace_packages # pip install "nvidia-pyindex~=1.0.5" @@ -62,11 +62,11 @@ extra_requirements = { } extra_requirements["all"] = list({d for l in extra_requirements.values() for d in l}) -packages = find_packages() +packages = find_namespace_packages() setup( name="plume-asr", - version="0.11", + version="0.2.0", description="Multi model ASR base package", url="http://github.com/malarinv/plume-asr", author="Malar Kannan",