Duplicate a public repository to my profile?

Hello and sorry for the question, maybe it was already discussed.

I browse many repositories and sometimes I find some interesting models and I would like to clone it into my own personal space. I know that I can download a file and reupload it in my repository but I was wondering if there was an option to just clone/transfer a file from a repository of another user to mine.

Cheers

1 Like

Hi! You can use this space to duplicate a repo, or do it manually as follows:

  1. git clone the original repo to the local machine
  2. create a new repository on the Hub
  3. git push the repo files to the new repository

Thanks but the idea was that I wanted to duplicate remotely. If I have to download 100 GB and reupload them, it is not convenient to make them transit on my machine locally. I wish there was a way to just do a “copy and paste” kind of thing with the files already on HF, just from a repository of someone else, to mine. Does that option exist at all?
Cheers

Unfortunately, it doesn’t at the moment.

Hi there! There is another Space, Repo_duplicator - a Hugging Face Space by osanseviero, which duplicates any repo. Under the hood it uses the duplicate endpoint, which you could also use. The format of the endpoint is /api/{repo_type}s/{source_repo}/duplicate and you can use it as shown in app.py · osanseviero/repo_duplicator at main.

5 Likes

Thanks, Is there also a way to duplicate a gated repo? Currently it returns an error if the repo is gated even if I have access to it.

@osanseviero thanks for the amazing tool! No more downloading and re-uploading

Is there a way to duplicate gated repos (to which I already have access)? I’m getting:

### Error 😢😢😢
    
     (Request ID: Root=1-66d1f1de-5e7b4079793597672264b39b)

403 Forbidden: Please enable access to public gated repositories in your fine-grained token settings to view this repository.. Cannot access content at: https://huggingface.co/api/models/benjamin-paine/stable-diffusion-v1-5/duplicate. If you are trying to create or update content,make sure you have a token with the write role.