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.

Allow to retrieve discussions/PRs using list_models

See original GitHub issue

It would be nice to have a discussions=True parameter in list_models and other listing methods, to also add the discussions related information in the response. At the moment, one needs to do list_models + get_repo_discussions for each, but that involves quite a bit of work.

@julien-c argument on keeping as they are was

config and cardData are properties of the model in the data backend, whereas discussions are another object completely

From my side, I don’t think that’s a distinction that users should know/internalize, and I would find making list_models more powerful a better approach from a user perspective

(internal discussion)

WDYT @julien-c @Pierrci @Wauplin

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Wauplincommented, Sep 22, 2022

Coding the helper in huggingface_hub directly is a bit clunky in my opinion. If the helper is just a for loop to get the discussions repo after repo, we end up with potentially thousands of calls to the API and a very long execution time

models = list_models()
for model in models:
    model.discussions = list(get_repo_discussions(model.id))

Even if we parallelize the calls, it still seems very unefficient.

1reaction
julien-ccommented, Sep 21, 2022

an API always reflect a bit the underlying data model, IMO

I’d be in favor of keeping the server API unchanged, but coding a helper in huggingface_hub could be an option (I thought you were suggesting changing the server API)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ListModels - Amazon SageMaker - AWS Documentation
To retrieve the next set of models, use the token in the next request. Type: String. Length Constraints: Maximum length of 8192. Pattern:...
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