Hi,
I was hoping someone could point in the right direction in being able to return the top n recommendations from a model built in the same way as the retrieval tutorial with context features. (link below)

  
      

      TensorFlow
  

  
    

Taking advantage of context features  |  TensorFlow Recommenders 2



  

  
    
    
  

  


Using the same code as in the very first tutorial in the series returns an error.
The code:
index = tfrs.layers.factorized_top_k.BruteForce(model.user_model)

recommends movies out of the entire movies dataset.
index.index_from_dataset(
tf.data.Dataset.zip((movies.batch(100), movies.batch(100).map(model.movie_model)))
)

Get recommendations.
_, titles = index(tf.constant([“42”]))
print(f"Recommendations for user 42: {titles[0, :3]}")