OpenCALM-3BをCPUで動かす
https://huggingface.co/cyberagent/open-calm-3b
pip install
#transformers
ja指定?
torch
accelerate
ImportError: Using low_cpu_mem_usage=True or a device_map requires Accelerate: pip install accelerate
hubからダウンロードできない(502)
https://huggingface.co/cyberagent/open-calm-3b/tree/main のファイル6つを手動ダウンロード
from_pretrainedにディレクトリを指定できる
CPUで動かす(macOS)
RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'
サンプルコードのtorch_dtype=torch.float16をtorch_dtype=torch.float32に変える必要がある
ref: you need to run your model on the GPU as the operations are not all implemented on the CPU in float16. On CPU you can only run models in float32.
CPUではfloat16がサポートされていない
3Bの選択理由
CyberAgentの日本語言語モデルを試してみる
GPUメモリは6.5GBくらい。8GBメモリのGPUでいけますね。
(7Bを)CPUで動かすと、読み込み時に最大で34GBくらいのメモリを消費した
hubからダウンロードしてくる実装
試している
アメリカの首都はワシントン。日本の首都は
吾輩は猫で
#colorama
RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'というエラーが出る場合はtorch_dtype=torch.float16を消す必要があります。