mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-17 05:40:42 -07:00
fix: address review feedback on CUDA backend swap
- Use YAML block scalar for inline run with colons (build-cuda.yml) - Explicitly set VOICEBOX_BACKEND_VARIANT=cpu instead of setdefault (server.py) - Use Path.replace() for atomic move on all platforms (cuda_download.py) - Log actual exception in checksum fetch warning (cuda_download.py)
This commit is contained in:
@@ -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 binary
|
||||
shell: bash
|
||||
|
||||
@@ -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 parts
|
||||
total_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 Unix
|
||||
if sys.platform != "win32":
|
||||
|
||||
+2
-2
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user