File size: 1,416 Bytes
e233283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# main_web.py — ZOTHEOS Hugging Face Entry Point

import logging
from zotheos_interface_public import (
    build_interface,
    logo_path_verified,
    favicon_path_verified,
    APP_TITLE
)

# Set up logging
logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
logger = logging.getLogger("ZOTHEOS_WebApp_HF")

# --- CRUCIAL FINAL CHECK ---
# Ensure your model loading code (likely in another file like 'modules/main_fusion_public.py')
# has been updated to use hf_hub_download.
# The server will download the models, so your code must not look for a local 'models/' folder.
logger.info("Verifying model loading strategy for web deployment...")
# (This is just a log message, the actual code change is in your backend file)

# --- Build and Launch the App ---
logger.info(f"Building Gradio UI for '{APP_TITLE}'...")
# Build the interface by calling the function from your other script
zotheos_app = build_interface(logo_path_verified, favicon_path_verified)

logger.info("UI built. Preparing to launch on Hugging Face Spaces...")
# The .queue() is important for handling multiple users.
# The .launch() command without arguments is what Hugging Face expects.
# It will handle the server and networking for you.
zotheos_app.queue().launch()

logger.info("ZOTHEOS app has been launched by the Hugging Face environment.")