删除下载的TensorFlow和Pytorch(拥抱面)型号
我想从笔记本电脑上删除Tensorflow和拥抱面部型号。 我确实找到了一个链接 https://github.com/github.com/huggingface/transforceface/transformers/sissues/861 但是是否没有命令可以删除它们一些错误。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
变形金刚库将将下载的文件存储在您的缓存中。据我所知,没有内置方法可以从缓存中删除某些模型。但是您可以自己编码一些内容。这些文件与具有
.json
的两个附加文件一起存储。 >附加到神秘的名称。 JSON文件包含一些可用于识别文件的元数据。以下是这样一个文件的示例:我们现在可以使用此信息来创建您的缓存文件列表,如下所示:
现在您要做的就是检查代码> cachedtokenizers 并决定是否要保留它们。如果要删除它们,只需检查字典的值,然后从缓存中删除文件即可。不要忘记还删除相应的
cachedmodels
and <*。json
和*。锁定
文件。The transformers library will store the downloaded files in your cache. As far as I know, there is no built-in method to remove certain models from the cache. But you can code something by yourself. The files are stored with a cryptical name alongside two additional files that have
.json
(.h5.json
in case of Tensorflow models) and.lock
appended to the cryptical name. The json file contains some metadata that can be used to identify the file. The following is an example of such a file:We can now use this information to create a list of your cached files as shown below:
Now all you have to do is to check the keys of
cachedModels
andcachedTokenizers
and decide if you want to keep them or not. In case you want to delete them, just check for the value of the dictionary and delete the file from the cache. Don't forget to also delete the corresponding*.json
and*.lock
files.您可以运行此代码以删除所有模型
You can run this code to delete all models
并找到您保存的gpt-2
model.save_pretaining(“ ./ English-gpt2”)。
您可以手动删除那条路。
and find where you have saved gpt-2
model.save_pretrained("./english-gpt2") .???
from that path you can manually delete.
使用
然后
您现在应该查看可以选择/取消选择的修订列表。
参见此链接 。
Use
Then
You should now see a list of revisions that you can select/deselect.
See this link for details.
来自注释找到缓存目录,以便您可以清洁:
From a comment in transformers github issue, you can use the following way to find the cache directory so that you can clean it: