File size: 1,289 Bytes
e1c010e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
app.py β€” VLA Demo entry point.

Compatible with:
  - Local:      python app.py
  - HF Spaces:  imported directly (demo object must exist at module level)

All UI logic lives in the src/ui/ package.
"""

import logging

from src.utils.config import (
    setup_logging, validate_config,
    LLM_PROVIDER, OPENAI_MODEL, GROQ_MODEL,
    DETECTION_MODEL,
)
from src.ui import create_ui

setup_logging()
logger = logging.getLogger(__name__)

for warning in validate_config():
    logger.warning(warning)

# ── Startup config summary ─────────────────────────────────────────────────
_active_model = GROQ_MODEL if LLM_PROVIDER == "groq" else OPENAI_MODEL
logger.info("=" * 60)
logger.info("  Codevally VLA Demo β€” startup configuration")
logger.info("  LLM Provider  : %s", LLM_PROVIDER.upper())
logger.info("  LLM Model     : %s", _active_model)
logger.info("  Vision Model  : %s", DETECTION_MODEL)
logger.info("=" * 60)

# Build the Gradio app at module level so HF Spaces can find it
demo = create_ui()

if __name__ == "__main__":
    logger.info("Launching Codevally VLA Demo...")
    demo.launch(
        server_name="0.0.0.0",
        server_port=7860,
        share=False,
    )