Spaces:
Sleeping
Sleeping
Kyosuke Ichikawa commited on
東北キャラクター追加とデフォルト変更 (#13)
Browse files* feat: Update VOICEVOX Core and models versions to 0.16.1 and 0.16.0 respectively
* feat: Add new characters and update speech patterns for VOICEVOX
* feat: Add Tohoku characters and update default character
- Add Tohoku Zunko (Style ID: 107), Tohoku Kiritan (108), Tohoku Itako (109)
- All use 21.vvm model file
- Update DEFAULT_CHARACTER1 from Shikoku Metan to Tohoku Kiritan
- Add speech patterns for new characters in templates
- Update all related tests to use new default character
- Update character mappings in E2E tests
- Fix code formatting issues
- .devcontainer/setup.sh +3 -2
- .vscode/tasks.json +1 -1
- Dockerfile +3 -2
- Makefile +6 -4
- scripts/download_voicevox.sh +15 -10
- tests/e2e/steps/audio_generation_steps.py +14 -5
- tests/e2e/steps/browser_state_steps.py +34 -7
- tests/e2e/steps/script_generation_steps.py +3 -3
- tests/unit/conftest.py +4 -4
- yomitalk/common/character.py +3 -0
- yomitalk/prompt_manager.py +1 -1
- yomitalk/templates/common.j2 +18 -3
.devcontainer/setup.sh
CHANGED
|
@@ -14,7 +14,8 @@ if [ ! -d "voicevox_core" ] || [ -z "$(ls -A voicevox_core 2>/dev/null)" ]; then
|
|
| 14 |
echo "🎤 Setting up VOICEVOX Core..."
|
| 15 |
chmod +x scripts/download_voicevox.sh
|
| 16 |
scripts/download_voicevox.sh \
|
| 17 |
-
--version 0.16.
|
|
|
|
| 18 |
--dir voicevox_core \
|
| 19 |
--skip-if-exists \
|
| 20 |
--accept-agreement
|
|
@@ -23,7 +24,7 @@ fi
|
|
| 23 |
# Install VOICEVOX Core Python module
|
| 24 |
echo "🐍 Installing VOICEVOX Core Python module..."
|
| 25 |
OS_TYPE="manylinux_2_34_x86_64"
|
| 26 |
-
VOICEVOX_VERSION="0.16.
|
| 27 |
WHEEL_URL="https://github.com/VOICEVOX/voicevox_core/releases/download/${VOICEVOX_VERSION}/voicevox_core-${VOICEVOX_VERSION}-cp310-abi3-${OS_TYPE}.whl"
|
| 28 |
pip install "${WHEEL_URL}" || echo "⚠️ Warning: Failed to install VOICEVOX Core wheel. You may need to install it manually."
|
| 29 |
|
|
|
|
| 14 |
echo "🎤 Setting up VOICEVOX Core..."
|
| 15 |
chmod +x scripts/download_voicevox.sh
|
| 16 |
scripts/download_voicevox.sh \
|
| 17 |
+
--core-version 0.16.1 \
|
| 18 |
+
--models-version 0.16.0 \
|
| 19 |
--dir voicevox_core \
|
| 20 |
--skip-if-exists \
|
| 21 |
--accept-agreement
|
|
|
|
| 24 |
# Install VOICEVOX Core Python module
|
| 25 |
echo "🐍 Installing VOICEVOX Core Python module..."
|
| 26 |
OS_TYPE="manylinux_2_34_x86_64"
|
| 27 |
+
VOICEVOX_VERSION="0.16.1"
|
| 28 |
WHEEL_URL="https://github.com/VOICEVOX/voicevox_core/releases/download/${VOICEVOX_VERSION}/voicevox_core-${VOICEVOX_VERSION}-cp310-abi3-${OS_TYPE}.whl"
|
| 29 |
pip install "${WHEEL_URL}" || echo "⚠️ Warning: Failed to install VOICEVOX Core wheel. You may need to install it manually."
|
| 30 |
|
.vscode/tasks.json
CHANGED
|
@@ -125,7 +125,7 @@
|
|
| 125 |
"label": "Install VOICEVOX Core",
|
| 126 |
"type": "shell",
|
| 127 |
"command": "bash",
|
| 128 |
-
"args": ["scripts/download_voicevox.sh", "--version", "0.16.0", "--dir", "voicevox_core", "--accept-agreement"],
|
| 129 |
"group": "build",
|
| 130 |
"presentation": {
|
| 131 |
"echo": true,
|
|
|
|
| 125 |
"label": "Install VOICEVOX Core",
|
| 126 |
"type": "shell",
|
| 127 |
"command": "bash",
|
| 128 |
+
"args": ["scripts/download_voicevox.sh", "--core-version", "0.16.1", "--models-version", "0.16.0", "--dir", "voicevox_core", "--accept-agreement"],
|
| 129 |
"group": "build",
|
| 130 |
"presentation": {
|
| 131 |
"echo": true,
|
Dockerfile
CHANGED
|
@@ -20,7 +20,8 @@ COPY . /app/
|
|
| 20 |
# シェルのセットオプション -e を使用して、コマンドが失敗したら即座にDockerビルドを失敗させる
|
| 21 |
RUN set -e && \
|
| 22 |
scripts/download_voicevox.sh \
|
| 23 |
-
--version 0.16.
|
|
|
|
| 24 |
--dir voicevox_core \
|
| 25 |
--skip-if-exists \
|
| 26 |
--accept-agreement
|
|
@@ -37,7 +38,7 @@ RUN pip install --timeout 300 --retries 3 -r requirements.txt
|
|
| 37 |
|
| 38 |
# VOICEVOX Core Python module installation
|
| 39 |
RUN OS_TYPE="manylinux_2_34_x86_64" && \
|
| 40 |
-
WHEEL_URL="https://github.com/VOICEVOX/voicevox_core/releases/download/0.16.
|
| 41 |
pip install ${WHEEL_URL}
|
| 42 |
|
| 43 |
# パーミッション問題を解決するため、dataディレクトリの権限を設定
|
|
|
|
| 20 |
# シェルのセットオプション -e を使用して、コマンドが失敗したら即座にDockerビルドを失敗させる
|
| 21 |
RUN set -e && \
|
| 22 |
scripts/download_voicevox.sh \
|
| 23 |
+
--core-version 0.16.1 \
|
| 24 |
+
--models-version 0.16.0 \
|
| 25 |
--dir voicevox_core \
|
| 26 |
--skip-if-exists \
|
| 27 |
--accept-agreement
|
|
|
|
| 38 |
|
| 39 |
# VOICEVOX Core Python module installation
|
| 40 |
RUN OS_TYPE="manylinux_2_34_x86_64" && \
|
| 41 |
+
WHEEL_URL="https://github.com/VOICEVOX/voicevox_core/releases/download/0.16.1/voicevox_core-0.16.1-cp310-abi3-${OS_TYPE}.whl" && \
|
| 42 |
pip install ${WHEEL_URL}
|
| 43 |
|
| 44 |
# パーミッション問題を解決するため、dataディレクトリの権限を設定
|
Makefile
CHANGED
|
@@ -11,7 +11,8 @@ VENV_PIP = $(VENV_DIR)/bin/pip
|
|
| 11 |
VENV_PRECOMMIT = $(VENV_DIR)/bin/pre-commit
|
| 12 |
|
| 13 |
# VOICEVOX related
|
| 14 |
-
|
|
|
|
| 15 |
VOICEVOX_SKIP_IF_EXISTS ?= true
|
| 16 |
VOICEVOX_ACCEPT_AGREEMENT ?= false
|
| 17 |
VOICEVOX_DIR = voicevox_core
|
|
@@ -100,7 +101,8 @@ setup: install-system-deps venv install-python-packages-lint install-python-pack
|
|
| 100 |
download-voicevox-core: venv
|
| 101 |
@echo "Running VOICEVOX Core download script..."
|
| 102 |
@scripts/download_voicevox.sh \
|
| 103 |
-
--version $(
|
|
|
|
| 104 |
--dir $(VOICEVOX_DIR) \
|
| 105 |
$(if $(filter true, $(VOICEVOX_SKIP_IF_EXISTS)), --skip-if-exists) \
|
| 106 |
$(if $(filter true, $(VOICEVOX_ACCEPT_AGREEMENT)), --accept-agreement)
|
|
@@ -113,8 +115,8 @@ download-voicevox-core: venv
|
|
| 113 |
install-voicevox-core-module: venv
|
| 114 |
@echo "Installing VOICEVOX Core Python module..."
|
| 115 |
@OS_TYPE="manylinux_2_34_x86_64"; \
|
| 116 |
-
WHEEL_URL="https://github.com/VOICEVOX/voicevox_core/releases/download/$(
|
| 117 |
-
$(VENV_PIP) install $$WHEEL_URL || echo "Failed to install wheel for $$OS_TYPE. Check available wheels at https://github.com/VOICEVOX/voicevox_core/releases/tag/$(
|
| 118 |
@echo "VOICEVOX Core Python module installed!"
|
| 119 |
|
| 120 |
#--------------------------------------------------------------
|
|
|
|
| 11 |
VENV_PRECOMMIT = $(VENV_DIR)/bin/pre-commit
|
| 12 |
|
| 13 |
# VOICEVOX related
|
| 14 |
+
VOICEVOX_CORE_VERSION = 0.16.1
|
| 15 |
+
VOICEVOX_MODELS_VERSION = 0.16.0
|
| 16 |
VOICEVOX_SKIP_IF_EXISTS ?= true
|
| 17 |
VOICEVOX_ACCEPT_AGREEMENT ?= false
|
| 18 |
VOICEVOX_DIR = voicevox_core
|
|
|
|
| 101 |
download-voicevox-core: venv
|
| 102 |
@echo "Running VOICEVOX Core download script..."
|
| 103 |
@scripts/download_voicevox.sh \
|
| 104 |
+
--core-version $(VOICEVOX_CORE_VERSION) \
|
| 105 |
+
--models-version $(VOICEVOX_MODELS_VERSION) \
|
| 106 |
--dir $(VOICEVOX_DIR) \
|
| 107 |
$(if $(filter true, $(VOICEVOX_SKIP_IF_EXISTS)), --skip-if-exists) \
|
| 108 |
$(if $(filter true, $(VOICEVOX_ACCEPT_AGREEMENT)), --accept-agreement)
|
|
|
|
| 115 |
install-voicevox-core-module: venv
|
| 116 |
@echo "Installing VOICEVOX Core Python module..."
|
| 117 |
@OS_TYPE="manylinux_2_34_x86_64"; \
|
| 118 |
+
WHEEL_URL="https://github.com/VOICEVOX/voicevox_core/releases/download/$(VOICEVOX_CORE_VERSION)/voicevox_core-$(VOICEVOX_CORE_VERSION)-cp310-abi3-$$OS_TYPE.whl"; \
|
| 119 |
+
$(VENV_PIP) install $$WHEEL_URL || echo "Failed to install wheel for $$OS_TYPE. Check available wheels at https://github.com/VOICEVOX/voicevox_core/releases/tag/$(VOICEVOX_CORE_VERSION)"
|
| 120 |
@echo "VOICEVOX Core Python module installed!"
|
| 121 |
|
| 122 |
#--------------------------------------------------------------
|
scripts/download_voicevox.sh
CHANGED
|
@@ -5,7 +5,8 @@
|
|
| 5 |
set -e # Exit immediately if a command exits with a non-zero status
|
| 6 |
|
| 7 |
# Default values
|
| 8 |
-
|
|
|
|
| 9 |
VOICEVOX_DIR="voicevox_core"
|
| 10 |
SKIP_IF_EXISTS=false
|
| 11 |
ACCEPT_AGREEMENT=false
|
|
@@ -17,7 +18,8 @@ show_help() {
|
|
| 17 |
echo "Usage: $0 [options]"
|
| 18 |
echo ""
|
| 19 |
echo "Options:"
|
| 20 |
-
echo " --version VERSION
|
|
|
|
| 21 |
echo " --dir DIR Directory to install VOICEVOX Core (default: $VOICEVOX_DIR)"
|
| 22 |
echo " --skip-if-exists Skip download only if VOICEVOX files already exist"
|
| 23 |
echo " --accept-agreement Auto-accept VOICEVOX license agreement"
|
|
@@ -27,8 +29,12 @@ show_help() {
|
|
| 27 |
# Parse arguments
|
| 28 |
while [[ $# -gt 0 ]]; do
|
| 29 |
case "$1" in
|
| 30 |
-
--version)
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
shift 2
|
| 33 |
;;
|
| 34 |
--dir)
|
|
@@ -77,6 +83,7 @@ download_voicevox_core() {
|
|
| 77 |
local version="$1"
|
| 78 |
local voicevox_dir="$2"
|
| 79 |
local accept_agreement="$3"
|
|
|
|
| 80 |
|
| 81 |
# Create directory if it doesn't exist
|
| 82 |
mkdir -p "$voicevox_dir"
|
|
@@ -95,9 +102,7 @@ download_voicevox_core() {
|
|
| 95 |
chmod +x "$downloader_path"
|
| 96 |
|
| 97 |
# Run the downloader
|
| 98 |
-
# Note: --
|
| 99 |
-
# Without this parameter, the downloader will always download the latest version
|
| 100 |
-
# regardless of the specified version due to official downloader behavior.
|
| 101 |
echo "Downloading VOICEVOX Core components..."
|
| 102 |
cd "$voicevox_dir" || { echo "Error: Failed to change directory to $voicevox_dir"; return 1; }
|
| 103 |
|
|
@@ -147,12 +152,12 @@ download_voicevox_core() {
|
|
| 147 |
|
| 148 |
if [ "$accept_agreement" = true ]; then
|
| 149 |
echo "Auto-accepting license agreement"
|
| 150 |
-
if ! run_download_with_retry "env $github_env echo y | ./download --devices cpu --
|
| 151 |
echo "Error: Failed to download VOICEVOX Core components"
|
| 152 |
return 1
|
| 153 |
fi
|
| 154 |
else
|
| 155 |
-
if ! run_download_with_retry "env $github_env ./download --devices cpu --
|
| 156 |
echo "Error: Failed to download VOICEVOX Core components"
|
| 157 |
return 1
|
| 158 |
fi
|
|
@@ -174,7 +179,7 @@ main() {
|
|
| 174 |
fi
|
| 175 |
|
| 176 |
echo "VOICEVOX Core not found or missing necessary library files. Starting download..."
|
| 177 |
-
if download_voicevox_core "$
|
| 178 |
echo "VOICEVOX Core files downloaded successfully!"
|
| 179 |
return 0
|
| 180 |
else
|
|
|
|
| 5 |
set -e # Exit immediately if a command exits with a non-zero status
|
| 6 |
|
| 7 |
# Default values
|
| 8 |
+
CORE_VERSION="0.16.1"
|
| 9 |
+
MODELS_VERSION="0.16.0"
|
| 10 |
VOICEVOX_DIR="voicevox_core"
|
| 11 |
SKIP_IF_EXISTS=false
|
| 12 |
ACCEPT_AGREEMENT=false
|
|
|
|
| 18 |
echo "Usage: $0 [options]"
|
| 19 |
echo ""
|
| 20 |
echo "Options:"
|
| 21 |
+
echo " --core-version VERSION VOICEVOX Core library version to download (default: $CORE_VERSION)"
|
| 22 |
+
echo " --models-version VERSION Voice models version to download (default: $MODELS_VERSION)"
|
| 23 |
echo " --dir DIR Directory to install VOICEVOX Core (default: $VOICEVOX_DIR)"
|
| 24 |
echo " --skip-if-exists Skip download only if VOICEVOX files already exist"
|
| 25 |
echo " --accept-agreement Auto-accept VOICEVOX license agreement"
|
|
|
|
| 29 |
# Parse arguments
|
| 30 |
while [[ $# -gt 0 ]]; do
|
| 31 |
case "$1" in
|
| 32 |
+
--core-version)
|
| 33 |
+
CORE_VERSION="$2"
|
| 34 |
+
shift 2
|
| 35 |
+
;;
|
| 36 |
+
--models-version)
|
| 37 |
+
MODELS_VERSION="$2"
|
| 38 |
shift 2
|
| 39 |
;;
|
| 40 |
--dir)
|
|
|
|
| 83 |
local version="$1"
|
| 84 |
local voicevox_dir="$2"
|
| 85 |
local accept_agreement="$3"
|
| 86 |
+
local models_version="$4"
|
| 87 |
|
| 88 |
# Create directory if it doesn't exist
|
| 89 |
mkdir -p "$voicevox_dir"
|
|
|
|
| 102 |
chmod +x "$downloader_path"
|
| 103 |
|
| 104 |
# Run the downloader
|
| 105 |
+
# Note: --models-version parameter is used to download the specified models version.
|
|
|
|
|
|
|
| 106 |
echo "Downloading VOICEVOX Core components..."
|
| 107 |
cd "$voicevox_dir" || { echo "Error: Failed to change directory to $voicevox_dir"; return 1; }
|
| 108 |
|
|
|
|
| 152 |
|
| 153 |
if [ "$accept_agreement" = true ]; then
|
| 154 |
echo "Auto-accepting license agreement"
|
| 155 |
+
if ! run_download_with_retry "env $github_env echo y | ./download --devices cpu --models-version ${models_version}"; then
|
| 156 |
echo "Error: Failed to download VOICEVOX Core components"
|
| 157 |
return 1
|
| 158 |
fi
|
| 159 |
else
|
| 160 |
+
if ! run_download_with_retry "env $github_env ./download --devices cpu --models-version ${models_version}"; then
|
| 161 |
echo "Error: Failed to download VOICEVOX Core components"
|
| 162 |
return 1
|
| 163 |
fi
|
|
|
|
| 179 |
fi
|
| 180 |
|
| 181 |
echo "VOICEVOX Core not found or missing necessary library files. Starting download..."
|
| 182 |
+
if download_voicevox_core "$CORE_VERSION" "$VOICEVOX_DIR" "$ACCEPT_AGREEMENT" "$MODELS_VERSION"; then
|
| 183 |
echo "VOICEVOX Core files downloaded successfully!"
|
| 184 |
return 0
|
| 185 |
else
|
tests/e2e/steps/audio_generation_steps.py
CHANGED
|
@@ -32,16 +32,16 @@ def podcast_script_is_generated(page: Page):
|
|
| 32 |
# Set a sample script in the script generation area
|
| 33 |
script_textarea = page.locator("textarea").nth(1)
|
| 34 |
sample_script = """
|
| 35 |
-
|
| 36 |
ずんだもん: よろしくお願いします!機械学習って難しそうですね。
|
| 37 |
-
|
| 38 |
ずんだもん: すごいのだ!どんなことができるんですか?
|
| 39 |
-
|
| 40 |
"""
|
| 41 |
script_textarea.fill(sample_script)
|
| 42 |
|
| 43 |
# Verify that the script has been set
|
| 44 |
-
assert "
|
| 45 |
|
| 46 |
|
| 47 |
@given("I have agreed to the VOICEVOX terms of service")
|
|
@@ -841,7 +841,16 @@ def change_character_settings_for_state_test(page: Page, character1: str, charac
|
|
| 841 |
|
| 842 |
if character1_dropdown.is_visible() and character2_dropdown.is_visible():
|
| 843 |
# Map character names to dropdown values using Japanese display names
|
| 844 |
-
character_mapping = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 845 |
|
| 846 |
# Set first character
|
| 847 |
char1_value = character_mapping.get(character1, character1)
|
|
|
|
| 32 |
# Set a sample script in the script generation area
|
| 33 |
script_textarea = page.locator("textarea").nth(1)
|
| 34 |
sample_script = """
|
| 35 |
+
東北きりたん: こんにちは、今回は機械学習の最新研究についてお話しします。
|
| 36 |
ずんだもん: よろしくお願いします!機械学習って難しそうですね。
|
| 37 |
+
東北きりたん: 大規模言語モデルは自然言語処理タスクにおいて人間に匹敵する性能を発揮できるようになっています。
|
| 38 |
ずんだもん: すごいのだ!どんなことができるんですか?
|
| 39 |
+
東北きりたん: 文章生成や翻訳、質問応答などのタスクで優れた結果を示しています。
|
| 40 |
"""
|
| 41 |
script_textarea.fill(sample_script)
|
| 42 |
|
| 43 |
# Verify that the script has been set
|
| 44 |
+
assert "東北きりたん:" in script_textarea.input_value()
|
| 45 |
|
| 46 |
|
| 47 |
@given("I have agreed to the VOICEVOX terms of service")
|
|
|
|
| 841 |
|
| 842 |
if character1_dropdown.is_visible() and character2_dropdown.is_visible():
|
| 843 |
# Map character names to dropdown values using Japanese display names
|
| 844 |
+
character_mapping = {
|
| 845 |
+
"Zundamon": "ずんだもん",
|
| 846 |
+
"Shikoku Metan": "四国めたん",
|
| 847 |
+
"Kyushu Sora": "九州そら",
|
| 848 |
+
"Chugoku Usagi": "中国うさぎ",
|
| 849 |
+
"Chubu Tsurugi": "中部つるぎ",
|
| 850 |
+
"Tohoku Zunko": "東北ずん子",
|
| 851 |
+
"Tohoku Kiritan": "東北きりたん",
|
| 852 |
+
"Tohoku Itako": "東北イタコ",
|
| 853 |
+
}
|
| 854 |
|
| 855 |
# Set first character
|
| 856 |
char1_value = character_mapping.get(character1, character1)
|
tests/e2e/steps/browser_state_steps.py
CHANGED
|
@@ -68,10 +68,10 @@ def configure_api_and_preferences(page: Page):
|
|
| 68 |
# Look for character dropdowns and select different characters
|
| 69 |
character_dropdowns = page.locator("select").all()
|
| 70 |
if len(character_dropdowns) >= 2:
|
| 71 |
-
# Set first character to
|
| 72 |
-
character_dropdowns[0].select_option(value="
|
| 73 |
-
# Set second character to
|
| 74 |
-
character_dropdowns[1].select_option(value="
|
| 75 |
logger.info("Character preferences configured")
|
| 76 |
except Exception as e:
|
| 77 |
logger.warning(f"Could not set character preferences: {e}")
|
|
@@ -475,7 +475,16 @@ def change_character_settings(page: Page, character1: str, character2: str):
|
|
| 475 |
|
| 476 |
if len(character_dropdowns) >= 2:
|
| 477 |
# Map character names to dropdown values
|
| 478 |
-
character_mapping = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 479 |
|
| 480 |
# Set first character
|
| 481 |
char1_value = character_mapping.get(character1, character1.lower().replace(" ", "_"))
|
|
@@ -717,7 +726,16 @@ def verify_character_values(page: Page, expected_character1: str, expected_chara
|
|
| 717 |
logger.info(f"Second character dropdown value: {second_char_value}")
|
| 718 |
|
| 719 |
# Map expected names to values
|
| 720 |
-
character_mapping = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 721 |
|
| 722 |
expected_char1_value = character_mapping.get(expected_character1, expected_character1.lower().replace(" ", "_"))
|
| 723 |
expected_char2_value = character_mapping.get(expected_character2, expected_character2.lower().replace(" ", "_"))
|
|
@@ -801,7 +819,16 @@ def verify_character_values_bs(page: Page, expected_character1: str, expected_ch
|
|
| 801 |
logger.info(f"Second character dropdown value: {second_char_value}")
|
| 802 |
|
| 803 |
# Map expected names to values
|
| 804 |
-
character_mapping = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 805 |
|
| 806 |
expected_char1_value = character_mapping.get(expected_character1, expected_character1.lower().replace(" ", "_"))
|
| 807 |
expected_char2_value = character_mapping.get(expected_character2, expected_character2.lower().replace(" ", "_"))
|
|
|
|
| 68 |
# Look for character dropdowns and select different characters
|
| 69 |
character_dropdowns = page.locator("select").all()
|
| 70 |
if len(character_dropdowns) >= 2:
|
| 71 |
+
# Set first character to Tohoku Kiritan
|
| 72 |
+
character_dropdowns[0].select_option(value="tohoku_kiritan")
|
| 73 |
+
# Set second character to Zundamon
|
| 74 |
+
character_dropdowns[1].select_option(value="zundamon")
|
| 75 |
logger.info("Character preferences configured")
|
| 76 |
except Exception as e:
|
| 77 |
logger.warning(f"Could not set character preferences: {e}")
|
|
|
|
| 475 |
|
| 476 |
if len(character_dropdowns) >= 2:
|
| 477 |
# Map character names to dropdown values
|
| 478 |
+
character_mapping = {
|
| 479 |
+
"Zundamon": "zundamon",
|
| 480 |
+
"Shikoku Metan": "shikoku_metan",
|
| 481 |
+
"Kyushu Sora": "kyushu_sora",
|
| 482 |
+
"Chugoku Usagi": "chugoku_usagi",
|
| 483 |
+
"Chubu Tsurugi": "chubu_tsurugi",
|
| 484 |
+
"Tohoku Zunko": "tohoku_zunko",
|
| 485 |
+
"Tohoku Kiritan": "tohoku_kiritan",
|
| 486 |
+
"Tohoku Itako": "tohoku_itako",
|
| 487 |
+
}
|
| 488 |
|
| 489 |
# Set first character
|
| 490 |
char1_value = character_mapping.get(character1, character1.lower().replace(" ", "_"))
|
|
|
|
| 726 |
logger.info(f"Second character dropdown value: {second_char_value}")
|
| 727 |
|
| 728 |
# Map expected names to values
|
| 729 |
+
character_mapping = {
|
| 730 |
+
"Zundamon": "zundamon",
|
| 731 |
+
"Shikoku Metan": "shikoku_metan",
|
| 732 |
+
"Kyushu Sora": "kyushu_sora",
|
| 733 |
+
"Chugoku Usagi": "chugoku_usagi",
|
| 734 |
+
"Chubu Tsurugi": "chubu_tsurugi",
|
| 735 |
+
"Tohoku Zunko": "tohoku_zunko",
|
| 736 |
+
"Tohoku Kiritan": "tohoku_kiritan",
|
| 737 |
+
"Tohoku Itako": "tohoku_itako",
|
| 738 |
+
}
|
| 739 |
|
| 740 |
expected_char1_value = character_mapping.get(expected_character1, expected_character1.lower().replace(" ", "_"))
|
| 741 |
expected_char2_value = character_mapping.get(expected_character2, expected_character2.lower().replace(" ", "_"))
|
|
|
|
| 819 |
logger.info(f"Second character dropdown value: {second_char_value}")
|
| 820 |
|
| 821 |
# Map expected names to values
|
| 822 |
+
character_mapping = {
|
| 823 |
+
"Zundamon": "zundamon",
|
| 824 |
+
"Shikoku Metan": "shikoku_metan",
|
| 825 |
+
"Kyushu Sora": "kyushu_sora",
|
| 826 |
+
"Chugoku Usagi": "chugoku_usagi",
|
| 827 |
+
"Chubu Tsurugi": "chubu_tsurugi",
|
| 828 |
+
"Tohoku Zunko": "tohoku_zunko",
|
| 829 |
+
"Tohoku Kiritan": "tohoku_kiritan",
|
| 830 |
+
"Tohoku Itako": "tohoku_itako",
|
| 831 |
+
}
|
| 832 |
|
| 833 |
expected_char1_value = character_mapping.get(expected_character1, expected_character1.lower().replace(" ", "_"))
|
| 834 |
expected_char2_value = character_mapping.get(expected_character2, expected_character2.lower().replace(" ", "_"))
|
tests/e2e/steps/script_generation_steps.py
CHANGED
|
@@ -87,11 +87,11 @@ def click_generate_script_button(page: Page):
|
|
| 87 |
|
| 88 |
# サンプルスクリプトを設定
|
| 89 |
sample_script = """
|
| 90 |
-
|
| 91 |
ずんだもん: よろしくお願いします!機械学習って難しそうですね。
|
| 92 |
-
|
| 93 |
ずんだもん: すごいのだ!どんなことができるんですか?
|
| 94 |
-
|
| 95 |
"""
|
| 96 |
script_textarea.fill(sample_script)
|
| 97 |
|
|
|
|
| 87 |
|
| 88 |
# サンプルスクリプトを設定
|
| 89 |
sample_script = """
|
| 90 |
+
東北きりたん: こんにちは、今回は機械学習の最新研究についてお話しします。
|
| 91 |
ずんだもん: よろしくお願いします!機械学習って難しそうですね。
|
| 92 |
+
東北きりたん: 大規模言語モデルは自然言語処理タスクにおいて人間に匹敵する性能を発揮できるようになっています。
|
| 93 |
ずんだもん: すごいのだ!どんなことができるんですか?
|
| 94 |
+
東北きりたん: 文章生成や翻訳、質問応答などのタスクで優れた結果を示しています。
|
| 95 |
"""
|
| 96 |
script_textarea.fill(sample_script)
|
| 97 |
|
tests/unit/conftest.py
CHANGED
|
@@ -39,11 +39,11 @@ def sample_pdf_content():
|
|
| 39 |
@pytest.fixture
|
| 40 |
def sample_script():
|
| 41 |
"""Fixture providing a sample podcast script for testing."""
|
| 42 |
-
return """
|
| 43 |
ずんだもん: よろしくお願いします!機械学習について教えてください。
|
| 44 |
-
|
| 45 |
ずんだもん: なるほど!どんな応用例がありますか?
|
| 46 |
-
|
| 47 |
ずんだもん: すごいのだ!これからも発展していきそうですね。
|
| 48 |
-
|
| 49 |
"""
|
|
|
|
| 39 |
@pytest.fixture
|
| 40 |
def sample_script():
|
| 41 |
"""Fixture providing a sample podcast script for testing."""
|
| 42 |
+
return """東北きりたん: こんにちは、今回のテーマは機械学習についてです。
|
| 43 |
ずんだもん: よろしくお願いします!機械学習について教えてください。
|
| 44 |
+
東北きりたん: 機械学習は、コンピュータがデータから学習し、予測や判断を行う技術です。
|
| 45 |
ずんだもん: なるほど!どんな応用例がありますか?
|
| 46 |
+
東北きりたん: 画像認識、自然言語処理、レコメンデーションシステムなど様々です。
|
| 47 |
ずんだもん: すごいのだ!これからも発展していきそうですね。
|
| 48 |
+
東北きりたん: そうですね。今後の発展が期待される分野です。
|
| 49 |
"""
|
yomitalk/common/character.py
CHANGED
|
@@ -14,6 +14,9 @@ class Character(Enum):
|
|
| 14 |
KYUSHU_SORA = ("九州そら", 16, "2.vvm") # 九州そら (normal)
|
| 15 |
CHUGOKU_USAGI = ("中国うさぎ", 61, "3.vvm") # 中国うさぎ (normal)
|
| 16 |
CHUBU_TSURUGI = ("中部つるぎ", 94, "18.vvm") # 中部つるぎ (normal)
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
def __init__(self, display_name: str, style_id: int, model_file: str):
|
| 19 |
self.display_name = display_name
|
|
|
|
| 14 |
KYUSHU_SORA = ("九州そら", 16, "2.vvm") # 九州そら (normal)
|
| 15 |
CHUGOKU_USAGI = ("中国うさぎ", 61, "3.vvm") # 中国うさぎ (normal)
|
| 16 |
CHUBU_TSURUGI = ("中部つるぎ", 94, "18.vvm") # 中部つるぎ (normal)
|
| 17 |
+
TOHOKU_ZUNKO = ("東北ずん子", 107, "21.vvm") # 東北ずん子 (normal)
|
| 18 |
+
TOHOKU_KIRITAN = ("東北きりたん", 108, "21.vvm") # 東北きりたん (normal)
|
| 19 |
+
TOHOKU_ITAKO = ("東北イタコ", 109, "21.vvm") # 東北イタコ (normal)
|
| 20 |
|
| 21 |
def __init__(self, display_name: str, style_id: int, model_file: str):
|
| 22 |
self.display_name = display_name
|
yomitalk/prompt_manager.py
CHANGED
|
@@ -77,7 +77,7 @@ class PromptManager:
|
|
| 77 |
}
|
| 78 |
DEFAULT_DOCUMENT_TYPE = DocumentType.PAPER
|
| 79 |
DEFAULT_MODE = PodcastMode.STANDARD
|
| 80 |
-
DEFAULT_CHARACTER1 = Character.
|
| 81 |
DEFAULT_CHARACTER2 = Character.ZUNDAMON
|
| 82 |
|
| 83 |
def __init__(self):
|
|
|
|
| 77 |
}
|
| 78 |
DEFAULT_DOCUMENT_TYPE = DocumentType.PAPER
|
| 79 |
DEFAULT_MODE = PodcastMode.STANDARD
|
| 80 |
+
DEFAULT_CHARACTER1 = Character.TOHOKU_KIRITAN
|
| 81 |
DEFAULT_CHARACTER2 = Character.ZUNDAMON
|
| 82 |
|
| 83 |
def __init__(self):
|
yomitalk/templates/common.j2
CHANGED
|
@@ -7,8 +7,8 @@
|
|
| 7 |
},
|
| 8 |
"四国めたん": {
|
| 9 |
"first_person": "わたし",
|
| 10 |
-
"sentence_end": ["
|
| 11 |
-
"characteristic": "
|
| 12 |
},
|
| 13 |
"九州そら": {
|
| 14 |
"first_person": "わたし",
|
|
@@ -23,7 +23,22 @@
|
|
| 23 |
"中部つるぎ": {
|
| 24 |
"first_person": "ぼく",
|
| 25 |
"sentence_end": ["だ", "だぞ", "だぞ"],
|
| 26 |
-
"characteristic": "ややトーンが低めで、ぶっきらぼう、あるいは「ツンデレ」の「ツン」の部分を思わせるような、少しトゲのある(あるいは素っ気ない)話し方をする。"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
}
|
| 28 |
} %}
|
| 29 |
|
|
|
|
| 7 |
},
|
| 8 |
"四国めたん": {
|
| 9 |
"first_person": "わたし",
|
| 10 |
+
"sentence_end": ["だわ", "なのよ", "じゃない", "かしら"],
|
| 11 |
+
"characteristic": "誰に対しても遠慮のないタメ口が基本。少し高飛車にも聞こえる女性的な言い回しが特徴。趣味は中二病妄想。"
|
| 12 |
},
|
| 13 |
"九州そら": {
|
| 14 |
"first_person": "わたし",
|
|
|
|
| 23 |
"中部つるぎ": {
|
| 24 |
"first_person": "ぼく",
|
| 25 |
"sentence_end": ["だ", "だぞ", "だぞ"],
|
| 26 |
+
"characteristic": "ややトーンが低めで、ぶっきらぼう、あるいは「ツンデレ」の「ツン」の部分を思わせるような、少しトゲのある(あるいは素っ気ない)話し方をする。「信長」という銘の妖刀を携え、他にも八本の妖刀を浮遊させ操る能力を持つ。"
|
| 27 |
+
},
|
| 28 |
+
"東北ずん子": {
|
| 29 |
+
"first_person": "わたし",
|
| 30 |
+
"sentence_end": ["です", "ますよ", "ですね"],
|
| 31 |
+
"characteristic": "穏やかで上品な口調。丁寧語を基本とし、優しく包容力のある話し方をする。趣味はずんだ餅づくりや、ずんだ餡を利用した創作料理づくり。弓道部所属。姉の東北ずん子のことは「ずんねえさま」と呼び慕っている。"
|
| 32 |
+
},
|
| 33 |
+
"東北きりたん": {
|
| 34 |
+
"first_person": "わたし",
|
| 35 |
+
"sentence_end": ["です", "ます", "でしょうか"],
|
| 36 |
+
"characteristic": "知的で落ち着いた話し方。丁寧語を使いつつ、論理的で分析的な発言をすることが多い。趣味はゲーム、ひきこもること、同人誌漁り。背中の「きりたんぽ」から味噌を撃ち出す「きりたん砲」が特技。"
|
| 37 |
+
},
|
| 38 |
+
"東北イタコ": {
|
| 39 |
+
"first_person": "わたし",
|
| 40 |
+
"sentence_end": ["だね", "だよ", "だべ", "じゃないか"],
|
| 41 |
+
"characteristic": "快活で面倒見の良い、頼れる姉御肌。ハキハキとした口調で、時折、親しみやすい東北弁のイントネーションが混じる。相手を元気づけたり、背中を押してくれたりするような、明るく力強い話し方が特徴。職業イタコとして働いている。NHKという名の九尾の妖狐を体内に宿しており、降霊術を行える。NHKへの嫌がらせとして霊が乗り移っているときは語尾に「にゃ」と付けている。"
|
| 42 |
}
|
| 43 |
} %}
|
| 44 |
|