Skip to content

Commit

Permalink
Fixed a CI error
Browse files Browse the repository at this point in the history
  • Loading branch information
myui committed Feb 2, 2025
1 parent f6231ed commit ecd6d75
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rtrec/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,13 @@ def recommend_batch(self, users: List[Any], candidate_items: Optional[List[Any]]
:param filter_interacted: Whether to filter out items the user has already interacted with
:return: List of top-K items recommended for each user
"""
user_ids = [
None if self.user_ids.pass_through and (user_id := self.user_ids.get_id(user)) > self.interactions.max_user_id
else user_id
for user in users
]
user_ids = []
for user in users:
uid = self.user_ids.get_id(user)
if self.user_ids.pass_through and uid > self.interactions.max_user_id:
user_ids.append(None)
else:
user_ids.append(uid)
candidate_item_ids = None
if candidate_items is not None:
candidate_item_ids = [
Expand Down

0 comments on commit ecd6d75

Please sign in to comment.