Skip to content

Commit

Permalink
Accept single arguments when positive and negative are both supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwiles committed Nov 17, 2020
1 parent 15bfd1b commit 475b013
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gensim/models/keyedvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,11 +742,11 @@ def most_similar(
clip_start = 0
clip_end = restrict_vocab

if isinstance(positive, KEY_TYPES + (ndarray,)) and not negative:
if isinstance(positive, KEY_TYPES + (ndarray,)):
# allow passing a single string-key or vector for the positive argument
positive = [positive]

if isinstance(negative, KEY_TYPES + (ndarray,)) and not positive:
if isinstance(negative, KEY_TYPES + (ndarray,)):
# allow passing a single string-key or vector for the negative argument
negative = [negative]

Expand Down

0 comments on commit 475b013

Please sign in to comment.