fix setup.py namespace package issue
parent
ed6117559a
commit
42082ff354
|
|
@ -58,40 +58,6 @@ def tts_jupyter():
|
||||||
display.display(seg)
|
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()
|
@app.command()
|
||||||
def gentle_preview(
|
def gentle_preview(
|
||||||
audio_path: Path,
|
audio_path: Path,
|
||||||
|
|
|
||||||
6
setup.py
6
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"
|
# 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})
|
extra_requirements["all"] = list({d for l in extra_requirements.values() for d in l})
|
||||||
packages = find_packages()
|
packages = find_namespace_packages()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="plume-asr",
|
name="plume-asr",
|
||||||
version="0.11",
|
version="0.2.0",
|
||||||
description="Multi model ASR base package",
|
description="Multi model ASR base package",
|
||||||
url="http://github.com/malarinv/plume-asr",
|
url="http://github.com/malarinv/plume-asr",
|
||||||
author="Malar Kannan",
|
author="Malar Kannan",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue