mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-03 09:05:17 -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
|
pip install torchaudio --index-url https://download.pytorch.org/whl/cu121
|
||||||
|
|
||||||
- name: Verify CUDA support in torch
|
- 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
|
- name: Build CUDA server binary
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ async def download_cuda_binary(version: Optional[str] = None):
|
|||||||
# Format: "sha256hex filename\n"
|
# Format: "sha256hex filename\n"
|
||||||
expected_sha = sha_resp.text.strip().split()[0]
|
expected_sha = sha_resp.text.strip().split()[0]
|
||||||
logger.info(f"Expected SHA-256: {expected_sha[:16]}...")
|
logger.info(f"Expected SHA-256: {expected_sha[:16]}...")
|
||||||
except Exception:
|
except Exception as e:
|
||||||
logger.warning("Could not fetch checksum file — skipping verification")
|
logger.warning(f"Could not fetch checksum file — skipping verification: {e}")
|
||||||
|
|
||||||
# Download and concatenate parts
|
# Download and concatenate parts
|
||||||
total_downloaded = 0
|
total_downloaded = 0
|
||||||
@@ -169,10 +169,8 @@ async def download_cuda_binary(version: Optional[str] = None):
|
|||||||
)
|
)
|
||||||
logger.info(f"Integrity verified: {actual[:16]}...")
|
logger.info(f"Integrity verified: {actual[:16]}...")
|
||||||
|
|
||||||
# Atomic move into place
|
# Atomic move into place (replace handles existing target on all platforms)
|
||||||
if final_path.exists():
|
temp_path.replace(final_path)
|
||||||
final_path.unlink()
|
|
||||||
temp_path.rename(final_path)
|
|
||||||
|
|
||||||
# Make executable on Unix
|
# Make executable on Unix
|
||||||
if sys.platform != "win32":
|
if sys.platform != "win32":
|
||||||
|
|||||||
+2
-2
@@ -84,8 +84,8 @@ if __name__ == "__main__":
|
|||||||
os.environ["VOICEBOX_BACKEND_VARIANT"] = "cuda"
|
os.environ["VOICEBOX_BACKEND_VARIANT"] = "cuda"
|
||||||
logger.info("Backend variant: CUDA")
|
logger.info("Backend variant: CUDA")
|
||||||
else:
|
else:
|
||||||
os.environ.setdefault("VOICEBOX_BACKEND_VARIANT", "cpu")
|
os.environ["VOICEBOX_BACKEND_VARIANT"] = "cpu"
|
||||||
logger.info(f"Backend variant: {os.environ['VOICEBOX_BACKEND_VARIANT']}")
|
logger.info("Backend variant: CPU")
|
||||||
|
|
||||||
logger.info(f"Parsed arguments: host={args.host}, port={args.port}, data_dir={args.data_dir}")
|
logger.info(f"Parsed arguments: host={args.host}, port={args.port}, data_dir={args.data_dir}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user