Spaces:
Runtime error
Runtime error
Commit
Β·
a518f79
1
Parent(s):
52a435b
bump concurrency_count
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
from huggingface_hub import list_spaces
|
3 |
from cachetools import TTLCache, cached
|
4 |
from toolz import groupby, valmap
|
|
|
5 |
# from diskcache import Cache
|
6 |
# import platform
|
7 |
|
@@ -43,7 +44,7 @@ def relative_rank(my_dict, target_key, filter_zero=False):
|
|
43 |
my_dict = {k: v for k, v in my_dict.items() if v != 0}
|
44 |
|
45 |
if target_key not in my_dict:
|
46 |
-
raise gr.Error(f"'{target_key}' not found
|
47 |
|
48 |
sorted_items = sorted(my_dict.items(), key=lambda item: item[1], reverse=True)
|
49 |
|
@@ -152,5 +153,4 @@ with gr.Blocks() as demo:
|
|
152 |
gr.Markdown("""## π
Top 100 Spaces by Likes π
""")
|
153 |
ranking_board = gr.Markdown(plot_top_n_spaces())
|
154 |
|
155 |
-
|
156 |
-
demo.launch()
|
|
|
2 |
from huggingface_hub import list_spaces
|
3 |
from cachetools import TTLCache, cached
|
4 |
from toolz import groupby, valmap
|
5 |
+
|
6 |
# from diskcache import Cache
|
7 |
# import platform
|
8 |
|
|
|
44 |
my_dict = {k: v for k, v in my_dict.items() if v != 0}
|
45 |
|
46 |
if target_key not in my_dict:
|
47 |
+
raise gr.Error(f"'{target_key}' not found please check the ID and try again.")
|
48 |
|
49 |
sorted_items = sorted(my_dict.items(), key=lambda item: item[1], reverse=True)
|
50 |
|
|
|
153 |
gr.Markdown("""## π
Top 100 Spaces by Likes π
""")
|
154 |
ranking_board = gr.Markdown(plot_top_n_spaces())
|
155 |
|
156 |
+
demo.queue(concurrency_count=4).launch()
|
|