LLM & sLLM

LLM (Large Language Model) & sLLM (Small Large Language Model)

언어모델관리

허깅페이스 언어모델 관리

참고자료 : https://discuss.pytorch.kr/t/huggingface/2470

import torch from transformers import AutoTokenizer, AutoModelForCausalLM

device = torch.device('cuda')

tokenizer = AutoTokenizer.from_pretrained(“model name”) model = AutoModelForCausalLM.from_pretrained(“model name”).to(device)

tokenizer = AutoTokenizer.from_pretrained(“model name”, cache_dir=다른경로)

model = AutoModelForCausalLM.from_pretrained(“model name”, cache_dir=다른경로).to(device)