Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check if a space is duplicated from another one using HF API? #1435

Open
zhimin-z opened this issue Sep 28, 2024 · 6 comments
Open

How to check if a space is duplicated from another one using HF API? #1435

zhimin-z opened this issue Sep 28, 2024 · 6 comments

Comments

@zhimin-z
Copy link

I cannot find any related specifications in the documentation...Thanks!

@tfrere
Copy link

tfrere commented Jan 16, 2025

Hi! I'm working with @clefourrier - we're trying to automatically parse duplicated spaces (to ignore them),
using the duplicated_from key in cardData.

duplicated_from seems to need manual input by the space owner.
However, on the hub, there's a "Duplicated from" field which seems to automatically detect when a space was forked from another space.

Would there be a way to make this latter info available through the API, and/or to sync both methods?

@clefourrier
Copy link
Member

clefourrier commented Jan 16, 2025

cc @Wauplin maybe, for the hf_hub aspects?

@Wauplin
Copy link
Contributor

Wauplin commented Jan 16, 2025

Unfortunately I don't think this info is publicly available via API (cc @coyotte508)

@zhimin-z
Copy link
Author

Unfortunately I don't think this info is publicly available via API (cc @coyotte508)

Thanks, but how could I automatically detect if a space is duplicated from other spaces?

@coyotte508
Copy link
Member

yes I don't think so at the moment, although it's in DB (originRepo), so it's not too hard to add it to the expand fields

@coyotte508
Copy link
Member

Unfortunately I don't think this info is publicly available via API (cc @coyotte508)

Thanks, but how could I automatically detect if a space is duplicated from other spaces?

at the moment you can do:

(curl https://huggingface.co/spaces/huggingfacejs/push-model-from-web | grep "Duplicated from") && echo "yes" || echo "no"
(curl https://huggingface.co/spaces/coyotte508/test-req | grep "Duplicated from") && echo "yes" || echo "no"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants