배움 로그/data science
huggingface에서 모델 다운로드 받기
eple
2024. 7. 8. 09:20
728x90
반응형
huggingface에서 LLM test해보려구 모델을 다운 받으려는데,
아 맞네, 하고 key 생성을 위해서 아래 방법을 참조했으나,
Command Line Interface (CLI)
The huggingface_hub Python package comes with a built-in CLI called huggingface-cli. This tool allows you to interact with the Hugging Face Hub directly from a terminal. For example, you can login to your account, create a repository, upload and download f
huggingface.co
처참하게 아래와 같이 command not found
pip install -U "huggingface_hub[cli]"
아래와 같이 입력해보라해서도 실패했는데, sudo 권한으로 했더니 성공
login을 위해 token 생성, 등록 완료
이제 다운받아야지 모델...
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
실행하면 열심히 다운받아진다 ㅎㅎ