Collection tutorial suggestions

#2
by Wauplin - opened

Hey @davanstrien ! I've read your collection tutorial and have a few minor comments:

  • Usage of notebook_login is (softly) deprecated in huggingface_hub as it's a simple alias for huggingface_hub.login(). So it's best to showcase login instead now. Exact same syntax and result but the advantage is that if someone copy-pastes it in a script, it still works :)
  • instead of computing the 10% threshold and then cutting at 13 it's also possible to directly sort the list and then cut. Something like that should work:
datasets = sorted(datasets, key=lambda item: item.likes, reverse=1)[:math.ceil(len(datasets) * 0.10)]

The advantage is that you don't need the "get_threshold" method. The drawback is that datasets with an equal number of likes are separated in an arbitrary way.

Librarian Bots org

Thanks for those suggestions :)

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment