0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Git】git lfs installを使用して大容量リポジトリをクローンする

Last updated at Posted at 2025-09-13

はじめに

ローカルでモデルを動かすため、 Hugging Face からリポジトリをクローンしようとしたところ、不完全なリポジトリがクローンされました。これは Git Large File Storage (Git LFS)という仕組みをリポジトリ側が使用しており、私の環境に Git LFS がインストールされていなかったことが原因でした。

インストール

WSL を使用しており、Ubuntu 環境だったので以下のコマンドでインストールできました。

$ sudo apt install git-lfs
$ git lfs install
Git LFS initialized.

クローン方法

いつもどおり git clone を実行するだけです。

git lfs を使用した場合

大きいサイズのファイルをダウンロードしていることが確認できます。

$ git clone https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-mnli-xnli
Cloning into 'mDeBERTa-v3-base-mnli-xnli'...
remote: Enumerating objects: 112, done.
remote: Total 112 (delta 0), reused 0 (delta 0), pack-reused 112 (from 1)
Receiving objects: 100% (112/112), 15.53 KiB | 15.53 MiB/s, done.
Resolving deltas: 100% (61/61), done.
Filtering content: 100% (6/6), 2.41 GiB | 10.60 MiB/s, done.

git lfs を使用しなかった場合

特にエラーはでません。そのため最初は正常にクローンできたと勘違いしました。

$ git clone https://huggingface.co/MoritzLaurer/mDeBERTa-v3-base-mnli-xnli
Cloning into 'mDeBERTa-v3-base-mnli-xnli'...
remote: Enumerating objects: 112, done.
remote: Total 112 (delta 0), reused 0 (delta 0), pack-reused 112 (from 1)
Receiving objects: 100% (112/112), 15.53 KiB | 5.18 MiB/s, done.
Resolving deltas: 100% (61/61), done.

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?