wandra13 commited on
Commit
1efe882
·
1 Parent(s): 9806101

Enhance Gradio app initialization in app.py by adding custom CSS and JS parameters to the Blocks component. Refactor asset loading to streamline the launch process by using a list comprehension for existing assets.

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -389,7 +389,7 @@ def build_multilingual_leaderboard():
389
  # GRADIO APP
390
  # ========================
391
 
392
- demo = gr.Blocks(title=TITLE)
393
 
394
  with demo:
395
  gr.HTML(f"""
@@ -526,13 +526,6 @@ with demo:
526
 
527
 
528
  if __name__ == "__main__":
529
- assets = []
530
  import os
531
- for p in [black_logo_path, white_logo_path]:
532
- if os.path.exists(p):
533
- assets.append(p)
534
- demo.launch(
535
- css=custom_css,
536
- js=custom_js,
537
- allowed_paths=assets if assets else None,
538
- )
 
389
  # GRADIO APP
390
  # ========================
391
 
392
+ demo = gr.Blocks(title=TITLE, css=custom_css, js=custom_js)
393
 
394
  with demo:
395
  gr.HTML(f"""
 
526
 
527
 
528
  if __name__ == "__main__":
 
529
  import os
530
+ assets = [p for p in [black_logo_path, white_logo_path] if os.path.exists(p)]
531
+ demo.launch(allowed_paths=assets if assets else None)