davanstrien HF Staff commited on
Commit
5966956
·
1 Parent(s): a80ee5f

Refactor get_papers function to check if papers

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -103,8 +103,8 @@ 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
- 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"]
 
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 papers_indexed_by_hf.get(False):
107
+ results += "# 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"]