davanstrien HF staff commited on
Commit
adf5d9a
β€’
1 Parent(s): cad4a51

add concurrency

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -79,7 +79,7 @@ def group_collection_items(collection_slug: str):
79
  items = collection.items
80
  return groupby(get_collection_type, items)
81
 
82
- @cached(cache=TTLCache(maxsize=1000, ttl=CACHE_TIME))
83
  def get_papers_for_collection(collection_slug: str):
84
  dataset_to_arxiv_id = create_dataset_to_arxiv_id_dict()
85
  models_to_arxiv_id = create_model_to_arxiv_id_dict()
@@ -155,4 +155,4 @@ gr.Interface(
155
  description=description,
156
  examples=examples,
157
  cache_examples=True,
158
- ).launch()
 
79
  items = collection.items
80
  return groupby(get_collection_type, items)
81
 
82
+ @cached(cache=TTLCache(maxsize=500, ttl=CACHE_TIME))
83
  def get_papers_for_collection(collection_slug: str):
84
  dataset_to_arxiv_id = create_dataset_to_arxiv_id_dict()
85
  models_to_arxiv_id = create_model_to_arxiv_id_dict()
 
155
  description=description,
156
  examples=examples,
157
  cache_examples=True,
158
+ ).queue(concurrency_count=4).launch()