File size: 930 Bytes
8f8a746
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
Hugging Face Spaces entry point.

Spaces expects a file named app.py at the repo root. This module simply
imports and runs the Gradio app from the `app/` package. Environment
variables (MINIMAX_API_KEY, CHATTERBOX_API_BASE_URL, ...) are injected
by the Spaces runtime from the "Variables and secrets" settings tab.
"""
from __future__ import annotations

import logging
import os

# Configure logging before anything else so startup warnings surface in
# the Space's "Logs" panel.
logging.basicConfig(
    level=os.getenv("LOG_LEVEL", "INFO"),
    format="%(asctime)s %(levelname)s %(name)s: %(message)s",
)

# Import the Gradio UI builder from the app package.
from app.ui import build_app  # noqa: E402

demo = build_app()

if __name__ == "__main__":
    # Spaces forwards port 7860 by default. share=False because HF serves
    # the public URL itself.
    demo.launch(server_name="0.0.0.0", server_port=7860, share=False)