JS6969 commited on
Commit
91cd67d
·
verified ·
1 Parent(s): 5e4989a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -36,6 +36,14 @@ except Exception:
36
  # ------------------------------
37
  APP_DIR = os.getcwd()
38
  SESSION_FILE = "/tmp/forge_session.json"
 
 
 
 
 
 
 
 
39
 
40
  # Settings live in a user cache dir (persists better than /tmp)
41
  CONFIG_DIR = os.path.expanduser("~/.cache/forgecaptions")
@@ -848,9 +856,8 @@ with gr.Blocks(css=BASE_CSS, title="ForgeCaptions") as demo:
848
 
849
  # ---- Header
850
  settings = load_settings()
851
- header_html = gr.HTML(_render_header_html(settings.get("logo_auto", True),
852
- settings.get("logo_px", 200),
853
- settings.get("logo_scale", 1.0)))
854
 
855
  # ---- Controls group
856
  with gr.Group():
 
36
  # ------------------------------
37
  APP_DIR = os.getcwd()
38
  SESSION_FILE = "/tmp/forge_session.json"
39
+ # --- Branding
40
+ LOGO_AUTOFIT = True # match logo height to title+subtitles stack
41
+ LOGO_HEIGHT_PX = 200 # used only if LOGO_AUTOFIT is False
42
+ LOGO_SCALE = 1.0 # multiplier when auto-fitting
43
+ LOGO_AUTOFIT = os.getenv("FORGE_LOGO_AUTOFIT", "1") == "1" if "FORGE_LOGO_AUTOFIT" in os.environ else LOGO_AUTOFIT
44
+ LOGO_HEIGHT_PX = int(os.getenv("FORGE_LOGO_PX", LOGO_HEIGHT_PX))
45
+ LOGO_SCALE = float(os.getenv("FORGE_LOGO_SCALE", LOGO_SCALE))
46
+
47
 
48
  # Settings live in a user cache dir (persists better than /tmp)
49
  CONFIG_DIR = os.path.expanduser("~/.cache/forgecaptions")
 
856
 
857
  # ---- Header
858
  settings = load_settings()
859
+ header_html = gr.HTML(_render_header_html(LOGO_AUTOFIT, LOGO_HEIGHT_PX, LOGO_SCALE))
860
+
 
861
 
862
  # ---- Controls group
863
  with gr.Group():