以llama為例:
https://huggingface.co/meta-llama/Llama-2-7b-hf
Github
# 1. 安裝完成后,首先先初始化;如果有反饋,一般表示初始化成功
git lfs install
?
# 2. 如果剛剛下載的那個項目沒啥更改,重新下一遍,不算麻煩事(因為下載大文件,一般會比較慢)
git lfs clone https://huggingface.co/meta-llama/Llama-2-7b-hf
# 在下載的過程中,你也可以查看一下,你剛剛無法解析的那個pkl大文件,是不是在這個項目中,(進入項目目錄)使用如下指令:
cd Llama-2-7b-hf/
git lfs track
?
# 3. 如果不想重新下載整個項目,可以使用如下命令,單獨下載需要使用lfs下載的大文件。
git lfs fetch
git lfs checkout
#(備選:git lfs pull),不建議
GIT_LFS_SKIP_SMUDGE=0 git clone https://huggingface.co/meta-llama/Llama-2-7b-hf
報錯
$ git clone https://huggingface.co/meta-llama/Llama-2-7b-hf
Cloning into 'Llama-2-7b-hf'...
fatal: unable to access 'https://huggingface.co/meta-llama/Llama-2-7b-hf/': Failed to connect to huggingface.co port 443 after 21050 ms: Timed out
找國內(nèi)鏡像
GIT_LFS_SKIP_SMUDGE=0
rm -rf *
git lfs clone clone https://gitee.com/hf-models/Llama-2-7b-hf.git
GIT_LFS_SKIP_SMUDGE=1 git clone https://gitee.com/hf-models/Llama-2-7b-hf.git
GIT_LFS_SKIP_SMUDGE=0 git clone https://gitee.com/hf-models/Llama-2-7b-hf.git
1
報錯
$ git lfs clone https://gitee.com/hf-models/Llama-2-7b-hf.git
WARNING: `git lfs clone` is deprecated and will not be updated
with new flags from `git clone`
`git clone` has been updated in upstream Git to have comparable
speeds to `git lfs clone`.
Cloning into 'Llama-2-7b-hf'...
remote: Enumerating objects: 33, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 33 (delta 9), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (33/33), 491.84 KiB | 631.00 KiB/s, done.
Resolving deltas: 100% (9/9), done.
Not in a Git repository.
注意 Not in a Git repository.
報錯,查看:
$ git rev-parse --is-inside-work-tree
fatal: unsafe repository ('E:/tst/t/Llama-2-7b-hf' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory E:/tst/t/Llama-2-7b-hf
因此:
git config --global --add safe.directory E:/tst/t/Llama-2-7b-hf
git lfs track
# 3. 如果不想重新下載整個項目,可以使用如下命令,單獨下載需要使用lfs下載的大文件。
git lfs fetch
git lfs checkout
#(備選:git lfs pull),不建議
使用git lfs fetch
,報錯:
$ git lfs fetch
fetch: Fetching reference refs/heads/main
[4ec71fd53e99766de38f24753b30c9e8942630e9e576a1ba27b0ec531e87be41] Object not found: [404] Object not found
[60632e7f2530e713d57cfe2152019a01b1018070ce497e1f0c7fae4bf1340314] Object not found: [404] Object not found
[fa574ee4fa536cc1dfc1c1baf622144fa037a5259967112eeb1a40c7cc00484a] Object not found: [404] Object not found
[fd491dd3738e74dd4e18b964b9f8a15f785d487ab2d0c03c7a7b22fdac7bce1a] Object not found: [404] Object not found
[41780b5dac322ac35598737e99208d90bdc632a1ba3389ebedbb46a1d8385a7f] Object not found: [404] Object not found
error: failed to fetch some objects from 'https://gitee.com/hf-models/Llama-2-7b-hf.git/info/lfs'
原因:
- 對象不存在:指定的對象在遠程倉庫中不存在。這可能是因為對象已被刪除、重命名或移動。請確保你正在嘗試獲取正確的對象。
- 訪問權(quán)限限制:你可能沒有足夠的權(quán)限來訪問遠程倉庫中的對象。請確保你具有正確的訪問權(quán)限,并且已經(jīng)通過身份驗證進行訪問。
2
報錯:
$ GIT_LFS_SKIP_SMUDGE=0 git clone https://gitee.com/hf-models/Llama-2-7b-hf.git
Cloning into 'Llama-2-7b-hf'...
remote: Enumerating objects: 33, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 33 (delta 9), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (33/33), 491.84 KiB | 729.00 KiB/s, done.
Resolving deltas: 100% (9/9), done.
Updating files: 100% (18/18), done.
Downloading model-00001-of-00002.safetensors (10 GB)/s
Error downloading object: model-00001-of-00002.safetensors (4ec71fd): Smudge error: Error downloading model-00001-of-00002.safetensors (4ec71fd53e99766de38f24753b30c9e8942630e9e576a1ba27b0ec531e87be41): [4ec71fd53e99766de38f24753b30c9e8942630e9e576a1ba27b0ec531e87be41] Object not found: [404] Object not found
Errors logged to 'E:\Llama-2-7b-hf\.git\lfs\logs\20231112T152236.9629598.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: model-00001-of-00002.safetensors: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
https://gitee.com/hf-models/Llama-2-7b-hf/tree/main
ref
https://blog.shipengx.com/archives/af0e9080.html文章來源:http://www.zghlxwxcb.cn/news/detail-757710.html
https://zhuanlan.zhihu.com/p/350011379文章來源地址http://www.zghlxwxcb.cn/news/detail-757710.html
到了這里,關(guān)于Git 服務(wù)器上的 LFS 下載的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!