Skip to content

Commit

Permalink
fix bug where sim was overloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrej Karpathy committed Mar 30, 2020
1 parent a721f51 commit 0c33d86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# load computed paper similarities
with open('sim.json', 'r') as f:
sim = json.load(f)
sim_dict = json.load(f)

# load search dictionary for each paper
with open('search.json', 'r') as f:
Expand Down Expand Up @@ -60,7 +60,7 @@ def sim(doi_prefix=None, doi_suffix=None):
if pix is None:
papers = []
else:
sim_ix, match = zip(*sim[str(pix)][:40]) # indices of closest papers
sim_ix, match = zip(*sim_dict[str(pix)][:40]) # indices of closest papers
papers = [jall['rels'][cix] for cix in sim_ix]
gvars = {'sort_order': 'sim'}
context = {'papers': papers, 'gvars': gvars}
Expand Down

0 comments on commit 0c33d86

Please sign in to comment.