From d4c85f4ac4cb627e2611359d18615d76eda29c90 Mon Sep 17 00:00:00 2001 From: yum Date: Sat, 16 Sep 2023 15:49:55 -0700 Subject: Bugfixes * uwu filter no longer adds extra whitespace before/after segments. This would defeat commit logic. * disabling phonemes works again - path to prefab was being quoted twice, breaking the codepath. --- GUI/GUI/GUI/PythonWrapper.cpp | 2 +- Scripts/transcribe_v2.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/GUI/GUI/GUI/PythonWrapper.cpp b/GUI/GUI/GUI/PythonWrapper.cpp index 4e1de41..d551965 100644 --- a/GUI/GUI/GUI/PythonWrapper.cpp +++ b/GUI/GUI/GUI/PythonWrapper.cpp @@ -646,7 +646,7 @@ bool PythonWrapper::GenerateAnimator( Log(out, "success!\n"); } if (!config.enable_phonemes) { - std::string prefab_path = Quote(std::filesystem::path(tastt_assets_path) / "World Constraint.prefab"); + std::string prefab_path = (std::filesystem::path(tastt_assets_path) / "World Constraint.prefab").string(); Log(out, "Remove audio sources from prefab at {}\n", prefab_path); Log(out, "Removing audio sources from prefab... "); if (!InvokeWithArgs({ remove_audio_srcs_path, diff --git a/Scripts/transcribe_v2.py b/Scripts/transcribe_v2.py index 4230b04..e8d7ef6 100644 --- a/Scripts/transcribe_v2.py +++ b/Scripts/transcribe_v2.py @@ -663,6 +663,11 @@ class UwuPlugin(StreamingPlugin): uwu_text = uwu_stdout.decode("utf-8") uwu_text = uwu_text.replace("\n", "") uwu_text = uwu_text.replace("\r", "") + if uwu_text.isspace(): + return "" + # Guarantee that the segment starts with a single space and + # doesn't end with whitespace. + uwu_text = " " + uwu_text.lstrip().rstrip() return uwu_text commit.delta = _to_uwu(commit.delta) commit.preview = _to_uwu(commit.preview) -- cgit v1.2.3