huggingface.js icon indicating copy to clipboard operation
huggingface.js copied to clipboard

Integration with the /api/collections endpoint?

Open unaidedelf8777 opened this issue 2 years ago • 9 comments

Hi,

I am currently working on a website for my org, and I was really hoping to be able to make a collection of our best models and datasets, so that they can be displayed on our landing page. However, Right now it seems that I will have to fetch the data from the collections API from a local site file. this also means that it will not be realtime, and I will have to manually update the websites files each time I want to update the site, which isn't ideal. It would be awesome if you guys could integrate the collections into the huggingface/hub.js library.

regards.

unaidedelf8777 avatar Oct 26 '23 01:10 unaidedelf8777

Cool idea, would be great to have support for this in the @huggingface/hub library

I'd adding a https://github.com/huggingface/huggingface.js/labels/good%20first%20issue label, anyone from the community wants to give it a try to implement it here?

Collection API is documented here BTW: https://huggingface.co/docs/hub/api#collections-api

image

(cc @xenova for visibility too)

julien-c avatar Oct 26 '23 13:10 julien-c

As additional resource, here is how it is implemented in the Python client: https://github.com/huggingface/huggingface_hub/blob/b3e06ae2f01b30b9ff9fe391245d56b0336b048c/src/huggingface_hub/hf_api.py#L5900. Might be worth taking a look while implementing the JS counterpart :wink:

Wauplin avatar Oct 26 '23 13:10 Wauplin

@julien-c and @Wauplin Can I work on this??

hackpk avatar Nov 24 '23 06:11 hackpk

@hackpk Yes, please go ahead! Thanks for proposing to contribute on this :hugs: If you have any question about the API, please let us know. Once you have a PR to review, please ping @coyotte508 for review. Looking forward to it!

Wauplin avatar Nov 24 '23 10:11 Wauplin

hi, @Wauplin and @coyotte508 I have worked on Sap Cds projects and do not understand much here it would be helpful if you could tell me how can I run and debug the code I have written in hub/src/lib to get the collections.

hackpk avatar Nov 25 '23 09:11 hackpk

you can add a .spec.ts file next to your .ts file and do pnpm run test to run it

coyotte508 avatar Nov 25 '23 11:11 coyotte508

Hi @coyotte508 is there any solution for this error image

Tried login with huggingface_hub login token but nothing.

hackpk avatar Nov 28 '23 11:11 hackpk

Answered in the PR @hackpk

coyotte508 avatar Nov 28 '23 12:11 coyotte508

Hey any update on this?

robert-j-webb avatar Jan 28 '25 20:01 robert-j-webb