lainlives commited on
Commit
2e21149
·
1 Parent(s): e14f635

typos and security

Browse files
Files changed (2) hide show
  1. main/app/app.py +13 -2
  2. main/app/variables.py +1 -1
main/app/app.py CHANGED
@@ -37,6 +37,10 @@ warnings.filterwarnings("ignore")
37
  for l in ["httpx", "gradio", "uvicorn", "httpcore", "urllib3"]:
38
  logging.getLogger(l).setLevel(logging.ERROR)
39
 
 
 
 
 
40
  js_code = (
41
  """
42
  () => {
@@ -493,6 +497,8 @@ snapshot_download(
493
  local_dir=dump_path,
494
  token=hf_token,
495
  )
 
 
496
  move_files_by_extension(dump_path, index_path_dump_path, weights_path_dump_path)
497
 
498
 
@@ -506,10 +512,15 @@ snapshot_download(
506
 
507
  client_mode = True # "--client" in sys.argv
508
 
 
 
 
 
 
509
  with gr.Blocks(
510
  title="📱",
511
  js=js_code if client_mode else None,
512
- theme=theme,
513
  css="<style> @import url('{fonts}'); * {{font-family: 'Courgette', cursive !important;}} body, html {{font-family: 'Courgette', cursive !important;}} h1, h2, h3, h4, h5, h6, p, button, input, textarea, label, span, div, select {{font-family: 'Courgette', cursive !important;}} </style>".format(
514
  fonts=font or "https://fonts.googleapis.com/css2?family=Courgette&display=swap"
515
  ),
@@ -558,7 +569,7 @@ with gr.Blocks(
558
  show_error=configs.get("app_show_error", False),
559
  inbrowser="--open" in sys.argv,
560
  share=share,
561
- allowed_paths=allow_disk,
562
  prevent_thread_lock=True,
563
  quiet=True,
564
  )
 
37
  for l in ["httpx", "gradio", "uvicorn", "httpcore", "urllib3"]:
38
  logging.getLogger(l).setLevel(logging.ERROR)
39
 
40
+ # ============================================================================================================
41
+ default_theme = "blurple"
42
+ downloadable_dirs = ["audios_path", "weights_path", "logs_path", "presets_path"]
43
+
44
  js_code = (
45
  """
46
  () => {
 
497
  local_dir=dump_path,
498
  token=hf_token,
499
  )
500
+
501
+
502
  move_files_by_extension(dump_path, index_path_dump_path, weights_path_dump_path)
503
 
504
 
 
512
 
513
  client_mode = True # "--client" in sys.argv
514
 
515
+ gradiotheme = gr.Theme.load(theme_file)
516
+
517
+ theme_file = os.path.join("assets", "theme", default_theme + ".json")
518
+
519
+
520
  with gr.Blocks(
521
  title="📱",
522
  js=js_code if client_mode else None,
523
+ theme=blurple,
524
  css="<style> @import url('{fonts}'); * {{font-family: 'Courgette', cursive !important;}} body, html {{font-family: 'Courgette', cursive !important;}} h1, h2, h3, h4, h5, h6, p, button, input, textarea, label, span, div, select {{font-family: 'Courgette', cursive !important;}} </style>".format(
525
  fonts=font or "https://fonts.googleapis.com/css2?family=Courgette&display=swap"
526
  ),
 
569
  show_error=configs.get("app_show_error", False),
570
  inbrowser="--open" in sys.argv,
571
  share=share,
572
+ allowed_paths=downloadable_dirs,
573
  prevent_thread_lock=True,
574
  quiet=True,
575
  )
main/app/variables.py CHANGED
@@ -267,7 +267,7 @@ export_format_choices = [
267
  ]
268
 
269
  language = configs.get("language", "en-US")
270
- theme = os.path.join("main", "configs", "theme.json")
271
  # configs.get("theme", "lainlives/dark")
272
 
273
  edgetts = configs.get("edge_tts")
 
267
  ]
268
 
269
  language = configs.get("language", "en-US")
270
+ theme = os.path.join("main", "configs", "blurple.json")
271
  # configs.get("theme", "lainlives/dark")
272
 
273
  edgetts = configs.get("edge_tts")