Data/Information

Hugging Face, pretrained models 불러오기

neulvo 2022. 2. 22. 22:07
 

Sharing models and tokenizers - Hugging Face Course

Using pretrained models The Model Hub makes selecting the appropriate model simple, so that using it in any downstream library can be done in a few lines of code. Let’s take a look at how to actually use one of these models, and how to contribute back to

huggingface.co

위의 링크의 내용

 

1. 파이프라인 패키지를 통해 불러오기

- 가장 단순하지만 Task에 맞는 모델을 불러와야함.

2. 모델 아키텍쳐 패키지를 통해 불러오기

3. 오토클래스 패키지를 통해 불러오기

- 체크포인트에 따라 토크나이저, 모델을 불러주기에 가장 간편

 

Hugging Face의 Models 탭을 통해 활용가능한 모델들을 확인할 수 있고

모델을 클릭하여 보면

이렇게 Model Card를 통해 모델 설명을 볼 수 있으며

오른쪽의 Train, Depoly, Use in Transformers 등의 버튼을 통해

이렇게 활용 코드를 따올 수 있다.

728x90

'Data > Information' 카테고리의 다른 글

Hugging Face, Token classification  (0) 2022.03.16
Huggig Face, Tokenizers  (0) 2022.02.25
Hugging Face, Datasets  (0) 2022.02.24
Hugging Face, Hub와 Repository 활용  (0) 2022.02.22
Hugging Face, fine-tuning 까지  (0) 2022.02.22