davanstrien HF Staff commited on
Commit
2f27244
·
1 Parent(s): 6c04839

Refactor get_papers function to display papers not

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -103,12 +103,13 @@ def get_papers(
103
  for paper in already_claimed[False]:
104
  url = f"https://huggingface.co/papers/{paper['id']}"
105
  results += f"- [{paper['title']}]({url})\n"
106
- for paper in papers_indexed_by_hf[False]:
107
  results += f"# Papers not yet indexed by Hugging Face\n"
108
- paper_title = paper["title"]
109
- arxiv_id = paper["externalIds"]["ArXiv"]
110
- url = f"https://huggingface.co/papers/{arxiv_id}"
111
- results += f"- [{paper_title}]({url})\n"
 
112
  return results
113
 
114
 
 
103
  for paper in already_claimed[False]:
104
  url = f"https://huggingface.co/papers/{paper['id']}"
105
  results += f"- [{paper['title']}]({url})\n"
106
+ if len(papers_indexed_by_hf[False]) > 0:
107
  results += f"# Papers not yet indexed by Hugging Face\n"
108
+ for paper in papers_indexed_by_hf[False]:
109
+ paper_title = paper["title"]
110
+ arxiv_id = paper["externalIds"]["ArXiv"]
111
+ url = f"https://huggingface.co/papers/{arxiv_id}"
112
+ results += f"- [{paper_title}]({url})\n"
113
  return results
114
 
115