Spaces:
Runtime error
Runtime error
Commit
Β·
1eb4ea3
1
Parent(s):
9ce3fb9
formatting
Browse files
app.py
CHANGED
@@ -85,29 +85,30 @@ def get_papers_for_collection(collection_slug: str):
|
|
85 |
collection = group_collection_items(collection_slug)
|
86 |
collection_datasets = collection.get("datasets", None)
|
87 |
collection_models = collection.get("models", None)
|
88 |
-
dataset_papers =
|
89 |
-
model_papers =
|
90 |
if collection_datasets is not None:
|
91 |
for dataset in collection_datasets:
|
92 |
-
if
|
93 |
data = {
|
94 |
-
"
|
95 |
-
"
|
96 |
-
|
|
|
|
|
97 |
}
|
98 |
-
dataset_papers.
|
99 |
if collection_models is not None:
|
100 |
for model in collection.get("models", []):
|
101 |
if arxiv_ids := models_to_arxiv_id.get(model.item_id, None):
|
102 |
data = {
|
103 |
-
"model": model.item_id,
|
104 |
"arxiv_ids": arxiv_ids,
|
105 |
"hub_paper_links": [
|
106 |
f"https://huggingface.co/papers/{arxiv_id}"
|
107 |
for arxiv_id in arxiv_ids
|
108 |
],
|
109 |
}
|
110 |
-
model_papers.
|
111 |
return {"datasets": dataset_papers, "models": model_papers}
|
112 |
|
113 |
|
|
|
85 |
collection = group_collection_items(collection_slug)
|
86 |
collection_datasets = collection.get("datasets", None)
|
87 |
collection_models = collection.get("models", None)
|
88 |
+
dataset_papers = defaultdict(dict)
|
89 |
+
model_papers = defaultdict(dict)
|
90 |
if collection_datasets is not None:
|
91 |
for dataset in collection_datasets:
|
92 |
+
if arxiv_ids := dataset_to_arxiv_id.get(dataset.item_id, None):
|
93 |
data = {
|
94 |
+
"arxiv_ids": arxiv_ids,
|
95 |
+
"hub_paper_links": [
|
96 |
+
f"https://huggingface.co/papers/{arxiv_id}"
|
97 |
+
for arxiv_id in arxiv_ids
|
98 |
+
],
|
99 |
}
|
100 |
+
dataset_papers[dataset.item_id] = data
|
101 |
if collection_models is not None:
|
102 |
for model in collection.get("models", []):
|
103 |
if arxiv_ids := models_to_arxiv_id.get(model.item_id, None):
|
104 |
data = {
|
|
|
105 |
"arxiv_ids": arxiv_ids,
|
106 |
"hub_paper_links": [
|
107 |
f"https://huggingface.co/papers/{arxiv_id}"
|
108 |
for arxiv_id in arxiv_ids
|
109 |
],
|
110 |
}
|
111 |
+
model_papers[model.item_id] = data
|
112 |
return {"datasets": dataset_papers, "models": model_papers}
|
113 |
|
114 |
|