add thumbnails for papers, which apparently ppl like

This commit is contained in:
Andrej Karpathy
2022-02-13 18:30:14 -08:00
parent f980c7947a
commit d7a303b410
4 changed files with 111 additions and 2 deletions
+3
View File
@@ -87,6 +87,8 @@ def render_pid(pid):
# render a single paper with just the information we need for the UI
pdb = get_papers()
tags = get_tags()
thumb_path = 'static/thumb/' + pid + '.jpg'
thumb_url = thumb_path if os.path.isfile(thumb_path) else ''
d = pdb[pid]
return dict(
weight = 0.0,
@@ -97,6 +99,7 @@ def render_pid(pid):
tags = ', '.join(t['term'] for t in d['tags']),
utags = [t for t, pids in tags.items() if pid in pids],
summary = d['summary'],
thumb_url = thumb_url,
)
def random_rank():