Skip to content

Commit

Permalink
return item_label if it is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Evans committed Dec 20, 2022
1 parent 1bd4398 commit ddb2fd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyrec/implicit/als.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_item_label(self, item_id):
return self.item_labels_idx.get(item_id)

def get_item_id(self, item_label):
return self.item_labels[item_label]
return item_label if isinstance(item_label, str) else self.item_labels[item_label]

def get_user_label(self, user_id):
return self.user_labels_idx.get(user_id)
Expand Down

0 comments on commit ddb2fd9

Please sign in to comment.