mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-18 14:20:42 -07:00
Update development server port and enhance GPU status reporting
- Changed the development server port in package.json from 17493 to 8000 for dev. - Improved GPU availability checks in main.py to include support for MPS on Apple Silicon. - Removed the Assets.car file from version control as it is no longer needed. - Updated .gitignore to reflect the removal of Assets.car.
This commit is contained in:
@@ -31,7 +31,6 @@ target/
|
||||
*~
|
||||
|
||||
tauri/src-tauri/gen/Assets.car
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
+17
-4
@@ -58,10 +58,14 @@ async def health():
|
||||
import os
|
||||
|
||||
tts_model = tts.get_tts_model()
|
||||
gpu_available = torch.cuda.is_available()
|
||||
|
||||
|
||||
# Check for GPU availability (CUDA or MPS)
|
||||
has_cuda = torch.cuda.is_available()
|
||||
has_mps = hasattr(torch.backends, 'mps') and torch.backends.mps.is_available()
|
||||
gpu_available = has_cuda or has_mps
|
||||
|
||||
vram_used = None
|
||||
if gpu_available:
|
||||
if has_cuda:
|
||||
vram_used = torch.cuda.memory_allocated() / 1024 / 1024 # MB
|
||||
|
||||
# Check if model is loaded - use the same logic as model status endpoint
|
||||
@@ -1053,13 +1057,22 @@ async def get_active_tasks():
|
||||
# STARTUP & SHUTDOWN
|
||||
# ============================================
|
||||
|
||||
def _get_gpu_status() -> str:
|
||||
"""Get GPU availability status."""
|
||||
if torch.cuda.is_available():
|
||||
return f"CUDA ({torch.cuda.get_device_name(0)})"
|
||||
elif hasattr(torch.backends, 'mps') and torch.backends.mps.is_available():
|
||||
return "MPS (Apple Silicon)"
|
||||
return "None (CPU only)"
|
||||
|
||||
|
||||
@app.on_event("startup")
|
||||
async def startup_event():
|
||||
"""Run on application startup."""
|
||||
print("voicebox API starting up...")
|
||||
database.init_db()
|
||||
print(f"Database initialized at {database._db_path}")
|
||||
print(f"GPU available: {torch.cuda.is_available()}")
|
||||
print(f"GPU available: {_get_gpu_status()}")
|
||||
|
||||
|
||||
@app.on_event("shutdown")
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
"dev": "cd tauri && bun run tauri dev",
|
||||
"dev:web": "cd web && bun run dev",
|
||||
"dev:landing": "cd landing && bun run dev",
|
||||
"dev:server": "uvicorn backend.main:app --reload --port 17493",
|
||||
"dev:server": "uvicorn backend.main:app --reload --port 8000",
|
||||
"build": "cd tauri && bun run tauri build",
|
||||
"build:web": "cd web && bun run build",
|
||||
"build:landing": "cd landing && bun run build",
|
||||
|
||||
Generated
+1
-1
@@ -4483,7 +4483,7 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "voicebox"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"core-foundation-sys",
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user