question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HfApi method to fetch "liked" models by current user

See original GitHub issue

Is your feature request related to a problem? Please describe.

The huggingface dashboard seems to only list the last 20 “liked” models and datasets for my account. I use the “like” button extensively for bookmarking models but recently realized I can only view a limited number. Adding an api method would also help for analysing a user’s interests.

Describe the solution you’d like

Something like this perhaps?

HfApi.get_liked(
  username: Optional[str] = None,
  auth_token: Optional[str] = None,
  entity_type: "all" | "model" | "space" | "dataset" = "all", 
  max_items: int = 100
) -> List[ModelInfo|SpaceInfo|DatasetInfo]

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
Wauplincommented, Dec 14, 2022

@creatorrr @camenduru It’s merged ! Feel free to use it from main branch 😃

# !pip install git+https://github.com/huggingface/huggingface_hub.git@main

from huggingface_hub import HfApi

api = HfApi()
api.like("bigcode/the-stack", repo_type="dataset")

likes = api.list_liked_repos()
likes.datasets
# ['bigcode/the-stack', ...]
3reactions
julien-ccommented, Dec 6, 2022

yes our backlog is LIFO =)

more seriously: coming soon!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hugging Face Hub API
Below is the documentation for the HfApi class, which serves as a Python wrapper for the Hugging Face Hub's API. All methods from...
Read more >
Using the Hub for model storage | Daniel van Strien
I'll use flyswot-test as a way of playing around with this. To start with we can use Repository to clone the current version...
Read more >
Get current user in Model Serializer - Stack Overflow
I found the answer looking through the DRF source code. class ActivitySerializer(serializers.ModelSerializer): # Create a custom method ...
Read more >
Hugging Face Transformers with Keras: Fine-tune a non ...
You can change the model_id to another BERT-like model for a ... To load the germaner dataset, we use the load_dataset() method from...
Read more >
Image Classification using Huggingface ViT | by Kenji Tee
Then using plt.gca() you'll be able to get the current polar axes of the ... Now, if we have a worker process, we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found