Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions backend/python/fish-speech/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.PHONY: fish-speech test-source-preparation
fish-speech: test-source-preparation
.PHONY: fish-speech test-source-preparation test-runtime-import
fish-speech: test-source-preparation test-runtime-import
bash install.sh

test-source-preparation:
bash prepare-source_test.sh

test-runtime-import:
bash run_test.sh

.PHONY: run
run: fish-speech
@echo "Running fish-speech..."
Expand Down
4 changes: 3 additions & 1 deletion backend/python/fish-speech/run.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash
backend_dir=$(dirname $0)
backend_dir=$(dirname "$(realpath "$0")")
if [ -d $backend_dir/common ]; then
source $backend_dir/common/libbackend.sh
else
source $backend_dir/../common/libbackend.sh
fi

export PYTHONPATH="${backend_dir}/fish-speech-src${PYTHONPATH:+:${PYTHONPATH}}"

startBackend $@
23 changes: 23 additions & 0 deletions backend/python/fish-speech/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(dirname "$(realpath "$0")")
WORK_DIR=$(mktemp -d)
trap 'rm -rf "$WORK_DIR"' EXIT

mkdir -p "$WORK_DIR/runtime/common" "$WORK_DIR/runtime/fish-speech-src/fish_speech"
cp "$SCRIPT_DIR/run.sh" "$WORK_DIR/runtime/run.sh"

cat > "$WORK_DIR/runtime/fish-speech-src/fish_speech/inference_engine.py" <<'PY'
IMPORT_OK = True
PY

cat > "$WORK_DIR/runtime/common/libbackend.sh" <<'SH'
startBackend() {
python3 -c 'from fish_speech.inference_engine import IMPORT_OK; assert IMPORT_OK'
}
SH

bash "$WORK_DIR/runtime/run.sh"

echo "PASS: runtime launcher imports relocated fish-speech source"
Loading