Spaces:
Sleeping
Sleeping
change zero-gpu support
Browse files14 unmodified lines151617181920185 unmodified lines20620720820921021121221321421521621721821914 unmodified linesimport pyopenjtalkimport soundfile as sf# ============================================================================# Configuration# ============================================================================185 unmodified linesreturn model_managers[model_name]# Initialize default modelget_model_manager(DEFAULT_MODEL)# ============================================================================# Gradio Interface Functions# ============================================================================def synthesise(text: str,model_name: str,14 unmodified lines151617181920212223242526272829185 unmodified lines21521621721821922022122222322422522622722822923023114 unmodified linesimport pyopenjtalkimport soundfile as sftry:import spacesexcept ImportError:class spaces:@staticmethoddef GPU(func):return func# ============================================================================# Configuration# ============================================================================185 unmodified linesreturn model_managers[model_name]# Pre-load all available modelsprint("Pre-loading all models for ZeroGPU...")for model_name in get_available_models():get_model_manager(model_name)print("All models loaded.")# ============================================================================# Gradio Interface Functions# ============================================================================@spaces.GPUdef synthesise(text: str,model_name: str,
app.py+15-3