Spaces:
Runtime error
Runtime error
Commit
Β·
0750ab5
1
Parent(s):
fd8aa7c
formatting
Browse files
app.py
CHANGED
|
@@ -1,17 +1,19 @@
|
|
| 1 |
-
|
| 2 |
-
from cachetools import TTLCache, cached
|
| 3 |
import platform
|
| 4 |
import re
|
|
|
|
|
|
|
| 5 |
import gradio as gr
|
| 6 |
-
from
|
| 7 |
from cytoolz import groupby
|
| 8 |
-
from
|
| 9 |
-
import os
|
| 10 |
from tqdm.auto import tqdm
|
|
|
|
| 11 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
| 12 |
is_macos = platform.system() == "Darwin"
|
| 13 |
LIMIT = None
|
| 14 |
-
CACHE_TIME = 60 * 5
|
|
|
|
| 15 |
|
| 16 |
@cached(cache=TTLCache(maxsize=100, ttl=CACHE_TIME))
|
| 17 |
def get_models():
|
|
@@ -113,5 +115,6 @@ def get_papers_for_collection(collection_slug: str):
|
|
| 113 |
|
| 114 |
|
| 115 |
url = "HF-IA-archiving/models-to-archive-65006a7fdadb8c628f33aac9"
|
|
|
|
| 116 |
|
| 117 |
-
gr.Interface(get_papers_for_collection,
|
|
|
|
| 1 |
+
import os
|
|
|
|
| 2 |
import platform
|
| 3 |
import re
|
| 4 |
+
from collections import defaultdict
|
| 5 |
+
|
| 6 |
import gradio as gr
|
| 7 |
+
from cachetools import TTLCache, cached
|
| 8 |
from cytoolz import groupby
|
| 9 |
+
from huggingface_hub import get_collection, list_datasets, list_models
|
|
|
|
| 10 |
from tqdm.auto import tqdm
|
| 11 |
+
|
| 12 |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
|
| 13 |
is_macos = platform.system() == "Darwin"
|
| 14 |
LIMIT = None
|
| 15 |
+
CACHE_TIME = 60 * 5 # 5 minutes
|
| 16 |
+
|
| 17 |
|
| 18 |
@cached(cache=TTLCache(maxsize=100, ttl=CACHE_TIME))
|
| 19 |
def get_models():
|
|
|
|
| 115 |
|
| 116 |
|
| 117 |
url = "HF-IA-archiving/models-to-archive-65006a7fdadb8c628f33aac9"
|
| 118 |
+
slug_input = gr.Text(url, interactive=True, label="Collection slug", max_lines=1)
|
| 119 |
|
| 120 |
+
gr.Interface(get_papers_for_collection, slug_input, "json").launch()
|