Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,14 +18,7 @@ import re
|
|
| 18 |
import hashlib
|
| 19 |
from functools import lru_cache
|
| 20 |
|
| 21 |
-
|
| 22 |
-
try:
|
| 23 |
-
import onnxruntime as ort
|
| 24 |
-
ONNX_AVAILABLE = True
|
| 25 |
-
logger.info("✅ ONNX Runtime available")
|
| 26 |
-
except ImportError:
|
| 27 |
-
ONNX_AVAILABLE = False
|
| 28 |
-
logger.warning("⚠️ ONNX Runtime not available, falling back to PyTorch")
|
| 29 |
|
| 30 |
# Ensure the cloned neutts-air repository is in the path
|
| 31 |
import sys
|
|
@@ -35,7 +28,14 @@ from neuttsair.neutts import NeuTTSAir
|
|
| 35 |
# Configure logging
|
| 36 |
logging.basicConfig(level=logging.INFO)
|
| 37 |
logger = logging.getLogger("NeuTTS-API")
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
# --- Configuration & Utility Functions ---
|
| 40 |
|
| 41 |
# Explicitly use CPU as per Dockerfile and Hugging Face free tier compatibility
|
|
|
|
| 18 |
import hashlib
|
| 19 |
from functools import lru_cache
|
| 20 |
|
| 21 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# Ensure the cloned neutts-air repository is in the path
|
| 24 |
import sys
|
|
|
|
| 28 |
# Configure logging
|
| 29 |
logging.basicConfig(level=logging.INFO)
|
| 30 |
logger = logging.getLogger("NeuTTS-API")
|
| 31 |
+
# ONNX Runtime import
|
| 32 |
+
try:
|
| 33 |
+
import onnxruntime as ort
|
| 34 |
+
ONNX_AVAILABLE = True
|
| 35 |
+
logger.info("✅ ONNX Runtime available")
|
| 36 |
+
except ImportError:
|
| 37 |
+
ONNX_AVAILABLE = False
|
| 38 |
+
logger.warning("⚠️ ONNX Runtime not available, falling back to PyTorch")
|
| 39 |
# --- Configuration & Utility Functions ---
|
| 40 |
|
| 41 |
# Explicitly use CPU as per Dockerfile and Hugging Face free tier compatibility
|