The open-source AI voice studio. Clone, dictate, create.
fix: address review feedback on CUDA backend swap
James Pinea69c21679481
diff --git a/.github/workflows/build-cuda.yml b/.github/workflows/build-cuda.ymlindex d2f9e326..7076b3f4 100644--- a/.github/workflows/build-cuda.yml+++ b/.github/workflows/build-cuda.yml@@ -33,7 +33,8 @@ jobs:pip install torchaudio --index-url https://download.pytorch.org/whl/cu121- name: Verify CUDA support in torch- run: python -c "import torch; print(f'CUDA available in build: {torch.cuda.is_available()}'); print(f'CUDA version: {torch.version.cuda}')"+ run: |+ python -c "import torch; print(f'CUDA available in build: {torch.cuda.is_available()}'); print(f'CUDA version: {torch.version.cuda}')"- name: Build CUDA server binaryshell: bashdiff --git a/backend/cuda_download.py b/backend/cuda_download.pyindex 46b0a55a..51a8302d 100644--- a/backend/cuda_download.py+++ b/backend/cuda_download.py@@ -126,8 +126,8 @@ async def download_cuda_binary(version: Optional[str] = None):# Format: "sha256hex filename\n"expected_sha = sha_resp.text.strip().split()[0]logger.info(f"Expected SHA-256: {expected_sha[:16]}...")- except Exception:- logger.warning("Could not fetch checksum file — skipping verification")+ except Exception as e:+ logger.warning(f"Could not fetch checksum file — skipping verification: {e}")# Download and concatenate partstotal_downloaded = 0@@ -169,10 +169,8 @@ async def download_cuda_binary(version: Optional[str] = None):)logger.info(f"Integrity verified: {actual[:16]}...")- # Atomic move into place- if final_path.exists():- final_path.unlink()- temp_path.rename(final_path)+ # Atomic move into place (replace handles existing target on all platforms)+ temp_path.replace(final_path)# Make executable on Unixif sys.platform != "win32":diff --git a/backend/server.py b/backend/server.pyindex 7ed7c1ec..9a26af4a 100644--- a/backend/server.py+++ b/backend/server.py@@ -84,8 +84,8 @@ if __name__ == "__main__":os.environ["VOICEBOX_BACKEND_VARIANT"] = "cuda"logger.info("Backend variant: CUDA")else:- os.environ.setdefault("VOICEBOX_BACKEND_VARIANT", "cpu")- logger.info(f"Backend variant: {os.environ['VOICEBOX_BACKEND_VARIANT']}")+ os.environ["VOICEBOX_BACKEND_VARIANT"] = "cpu"+ logger.info("Backend variant: CPU")logger.info(f"Parsed arguments: host={args.host}, port={args.port}, data_dir={args.data_dir}")