Spaces:
Running
Running
File size: 1,579 Bytes
94fd4b0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
#!/usr/bin/env python3
"""
Simple build test for C-3PO TTS API
Tests if all dependencies can be imported
"""
def test_imports():
"""Test if all required packages can be imported"""
print("π Testing imports...")
try:
import fastapi
print("β
FastAPI")
import uvicorn
print("β
Uvicorn")
import torch
print("β
PyTorch")
import torchaudio
print("β
TorchAudio")
import TTS
print("β
Coqui TTS")
import huggingface_hub
print("β
Hugging Face Hub")
import pydantic
print("β
Pydantic")
return True
except ImportError as e:
print(f"β Import failed: {e}")
return False
def test_api_creation():
"""Test if the API can be created without errors"""
print("\nπ Testing API creation...")
try:
from coqui_api import app
print("β
API created successfully")
return True
except Exception as e:
print(f"β API creation failed: {e}")
return False
def main():
"""Run build tests"""
print("π§ͺ C-3PO TTS Build Test")
print("=" * 30)
import_ok = test_imports()
api_ok = test_api_creation()
print("\n" + "=" * 30)
if import_ok and api_ok:
print("π All tests passed! Ready to deploy.")
return 0
else:
print("β Some tests failed. Check dependencies.")
return 1
if __name__ == "__main__":
exit(main()) |