# How can I delete a model repository

**URL:** <https://discuss.huggingface.co/t/how-can-i-delete-a-model-repository/2097>\
**Category:** Models\
**Created:** [November 17, 2020, 1:08pm UTC](https://discuss.huggingface.co/t/how-can-i-delete-a-model-repository/2097 "2020-11-17T13:08:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagorsarker](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sagorsarker/32/26914_2.png) [@sagorsarker](https://discuss.huggingface.co/u/sagorsarker)\
**Post date:** [November 17, 2020, 1:08pm UTC](https://discuss.huggingface.co/t/how-can-i-delete-a-model-repository/2097/1 "2020-11-17T13:08:12Z")

</div>

Hi,  
Sorry if this is a duplicate thread.  
Thanks for this beautiful platform for sharing our models and datasets.

My question is, **how can I delete a model repository from huggingface model hub?**

Thanks in advance.  
Sagor

---

<div class="post-metadata">

**Author:** ![julien-c](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/julien-c/32/41937_2.png) [@julien-c](https://discuss.huggingface.co/u/julien-c)\
**Post date:** [November 19, 2020, 10:58am UTC](https://discuss.huggingface.co/t/how-can-i-delete-a-model-repository/2097/2 "2020-11-19T10:58:18Z")

</div>

To delete a model repository, right now you need to do it in code from the transformers library and do something like:

```python
from transformers.hf_api import HfApi

HfApi().delete_repo(...)

```

We’ll ship a UI to do it directly from the website in the coming days, though. (cc @pierric @thomwolf)

---

<div class="post-metadata">

**Author:** ![sagorsarker](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sagorsarker/32/26914_2.png) [@sagorsarker](https://discuss.huggingface.co/u/sagorsarker)\
**Post date:** [November 19, 2020, 1:37pm UTC](https://discuss.huggingface.co/t/how-can-i-delete-a-model-repository/2097/3 "2020-11-19T13:37:38Z")

</div>

Hi @julien-c  
Just delete one of my repo using this method.  
Thank you. Hope will get UI option soon.  
regards

---

<div class="post-metadata">

**Author:** ![julien-c](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/julien-c/32/41937_2.png) [@julien-c](https://discuss.huggingface.co/u/julien-c)\
**Post date:** [December 4, 2020, 7:49am UTC](https://discuss.huggingface.co/t/how-can-i-delete-a-model-repository/2097/4 "2020-12-04T07:49:54Z")

</div>

@sagorsarker UI option is up, see [🔥 [New] You can now delete a model from the website!](https://discuss.huggingface.co/t/new-you-can-now-delete-a-model-from-the-website/2481)

---

<div class="post-metadata">

**Author:** ![sagorsarker](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sagorsarker/32/26914_2.png) [@sagorsarker](https://discuss.huggingface.co/u/sagorsarker)\
**Post date:** [December 4, 2020, 11:33am UTC](https://discuss.huggingface.co/t/how-can-i-delete-a-model-repository/2097/5 "2020-12-04T11:33:29Z")

</div>

amazing. thanks @julien-c for letting me know.  
regards

---

<div class="post-metadata">

**Author:** ![Vasan](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@Vasan](https://discuss.huggingface.co/u/Vasan)\
**Post date:** [January 18, 2022, 11:58pm UTC](https://discuss.huggingface.co/t/how-can-i-delete-a-model-repository/2097/6 "2022-01-18T23:58:47Z")

</div>

Note: Problem encountered after deleting a model using the website:  
(I am assuming that ‘project’ and ‘model’ are synonyms)  
[🔥 [New] You can now delete a model from the website!](https://discuss.huggingface.co/t/new-you-can-now-delete-a-model-from-the-website/2481).  
If a model is created with the same name again,the project (model) is created. However on attempt to load data, the following error occurs:  
Traceback (most recent call last):  
File “/home/vv/git/hf/venv/lib/python3.8/site-packages/huggingface\_hub/repository.py”, line 359, in git\_pull  
subprocess.run(  
File “/usr/lib/python3.8/subprocess.py”, line 516, in run  
raise CalledProcessError(retcode, process.args,  
subprocess.CalledProcessError: Command ‘[‘git’, ‘pull’]’ returned non-zero exit status 128.

I have tried this twice, and finally ended up creating a model with a different name. So it appears that model deletion still leaves some remnants that lead to this issue.
