|
|
|
from UI import create_interface |
|
import interface as app_interface_module |
|
import sys |
|
from pathlib import Path |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
current_dir = Path(__file__).parent |
|
if str(current_dir) not in sys.path: |
|
sys.path.insert(0, str(current_dir)) |
|
import decorators |
|
|
|
class _GPUNeutralizerLocal: |
|
def __init__(self, *args, **kwargs): pass |
|
def __call__(self, func): return func |
|
|
|
|
|
if hasattr(decorators, 'GPU'): |
|
decorators.GPU = _GPUNeutralizerLocal |
|
print("INFO (app.py): 'decorators.GPU' neutralizado para ejecuci贸n local.") |
|
if hasattr(decorators, 'gpu_decorator'): |
|
decorators.gpu_decorator = lambda duration=0: lambda func: func |
|
print("INFO (app.py): 'decorators.gpu_decorator' neutralizado para ejecuci贸n local.") |
|
|
|
except ImportError: |
|
print("ADVERTENCIA (app.py): M贸dulo 'decorators' no encontrado, no se pudo neutralizar GPU. Puede que no sea necesario.") |
|
except Exception as e_dec: |
|
print(f"ADVERTENCIA (app.py): Error al intentar neutralizar decoradores: {e_dec}") |
|
|
|
|
|
|
|
def main(): |
|
|
|
|
|
demo_instance = create_interface(process_function_for_button=app_interface_module.process_and_plot) |
|
|
|
print("Lanzando interfaz Gradio localmente...") |
|
demo_instance.launch() |
|
|
|
if __name__ == "__main__": |
|
main() |