CK-Explorer commited on
Commit
5ff4cf9
·
1 Parent(s): af0de6e

feat: set the concurrency merging limits to 15, and maximum queue to 30

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. ui/layout.py +8 -2
app.py CHANGED
@@ -1,4 +1,5 @@
1
  from ui.layout import create_main_gr_blocks_ui as duosubs_gr_blocks
2
 
3
- app = duosubs_gr_blocks()
 
4
  app.launch()
 
1
  from ui.layout import create_main_gr_blocks_ui as duosubs_gr_blocks
2
 
3
+ app = duosubs_gr_blocks(merging_concurrency_limit=15)
4
+ app.queue(max_size=30, default_concurrency_limit=None)
5
  app.launch()
ui/layout.py CHANGED
@@ -29,14 +29,19 @@ model_pool = create_model_pools(MODEL_NAME_LIST)
29
 
30
  def create_main_gr_blocks_ui(
31
  cache_delete_frequency: int = 3600,
32
- cache_delete_age: int = 14400
 
33
  ) -> gr.Blocks:
34
  """
35
  Builds and returns the main Gradio Blocks UI for DuoSubs.
36
 
37
  Args:
38
  cache_delete_frequency (int): How often to delete cache (seconds).
 
39
  cache_delete_age (int): Age threshold for cache deletion (seconds).
 
 
 
40
 
41
  Returns:
42
  gradio.Blocks: The constructed Gradio UI.
@@ -108,7 +113,8 @@ def create_main_gr_blocks_ui(
108
  secondary_format,
109
  cancel_state
110
  ],
111
- outputs=merged_file
 
112
  ).then(
113
  fn=states_after_merging,
114
  inputs=cancel_state,
 
29
 
30
  def create_main_gr_blocks_ui(
31
  cache_delete_frequency: int = 3600,
32
+ cache_delete_age: int = 14400,
33
+ merging_concurrency_limit: int = 5
34
  ) -> gr.Blocks:
35
  """
36
  Builds and returns the main Gradio Blocks UI for DuoSubs.
37
 
38
  Args:
39
  cache_delete_frequency (int): How often to delete cache (seconds).
40
+ Default is 1 hour or 3600 seconds.
41
  cache_delete_age (int): Age threshold for cache deletion (seconds).
42
+ Default is 4 hour or 14400 seconds.
43
+ merging_concurrency_limit (int): Maximum number of concurrent merges allowed.
44
+ Default is 5.
45
 
46
  Returns:
47
  gradio.Blocks: The constructed Gradio UI.
 
113
  secondary_format,
114
  cancel_state
115
  ],
116
+ outputs=merged_file,
117
+ concurrency_limit=merging_concurrency_limit
118
  ).then(
119
  fn=states_after_merging,
120
  inputs=cancel_state,