From 2542312afbf4b00041f283cdde6f7c59809fceb6 Mon Sep 17 00:00:00 2001 From: Sungmin Oh Date: Fri, 20 Sep 2024 11:48:22 +0900 Subject: [PATCH 1/3] feat: nmt draft --- docs/source/ko/main_classes/model.md | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 docs/source/ko/main_classes/model.md diff --git a/docs/source/ko/main_classes/model.md b/docs/source/ko/main_classes/model.md new file mode 100644 index 00000000000000..5076331f9af877 --- /dev/null +++ b/docs/source/ko/main_classes/model.md @@ -0,0 +1,68 @@ + + +# Models + +기본 클래스 [`PreTrainedModel`], [`TFPreTrainedModel`], [`FlaxPreTrainedModel`]는 로컬 파일과 디렉토리로부터 모델을 로드하고 저장하거나 또는 (허깅페이스 AWS S3 리포지토리로부터 다운로드된) 라이브러리에서 제공하는 사전훈련 모델 설정값을 로드하고 저장하는 것을 지원하는 기본 메소드를 구현하였습니다. + +[`PreTrainedModel`]과 [`TFPreTrainedModel`]은 또한 모든 모델들에 공통적으로 지원하는 몇가지 메소드를 구현하였습니다: + +- 새 토큰이 단어장에 추가될 때, 입력 토큰 임베딩의 크기를 조정합니다. +- 모델의 어텐션 헤드를 가지치기합니다. + +각 모델에 공통인 다른 메소드들은 다음과 같은 클래스에 정의 되어있습니다. +- [`~modeling_utils.ModuleUtilsMixin`](파이토치 모델용) +- 텍스트 생성을 위한 [`~modeling_tf_utils.TFModuleUtilsMixin`](텐서플로 모델용) +- [`~generation.GenerationMixin`](파이토치 모델용) +- [`~generation.FlaxGenerationMixin`](Flax/JAX 모델용) + +## PreTrainedModel + +[[autodoc]] PreTrainedModel + - push_to_hub + - all + +사용자정의 모델은 superfast init이 특정모델에 적용될 수 있는지 여부를 결정하는 `_supports_assign_param_buffer`도 포함해야합니다. +`test_save_and_load_from_pretrained`이 실패하면, 당신의 모델이 `_supports_assign_param_buffer`를 필요로 하는지 확인하세요. +필요로 한다면 `False`로 설정하세요. + +## ModuleUtilsMixin + +[[autodoc]] modeling_utils.ModuleUtilsMixin + +## TFPreTrainedModel + +[[autodoc]] TFPreTrainedModel + - push_to_hub + - all + +## TFModelUtilsMixin + +[[autodoc]] modeling_tf_utils.TFModelUtilsMixin + +## FlaxPreTrainedModel + +[[autodoc]] FlaxPreTrainedModel + - push_to_hub + - all + +## Pushing to the Hub + +[[autodoc]] utils.PushToHubMixin + +## Sharded checkpoints + +[[autodoc]] modeling_utils.load_sharded_checkpoint From 7bc9330b48a891515dc685e5b8cc61b2f824eefa Mon Sep 17 00:00:00 2001 From: Sungmin Oh Date: Fri, 20 Sep 2024 11:49:36 +0900 Subject: [PATCH 2/3] fix: manual edits --- docs/source/ko/main_classes/model.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/ko/main_classes/model.md b/docs/source/ko/main_classes/model.md index 5076331f9af877..9283edcabc7f69 100644 --- a/docs/source/ko/main_classes/model.md +++ b/docs/source/ko/main_classes/model.md @@ -14,7 +14,7 @@ rendered properly in your Markdown viewer. --> -# Models +# 모델 기본 클래스 [`PreTrainedModel`], [`TFPreTrainedModel`], [`FlaxPreTrainedModel`]는 로컬 파일과 디렉토리로부터 모델을 로드하고 저장하거나 또는 (허깅페이스 AWS S3 리포지토리로부터 다운로드된) 라이브러리에서 제공하는 사전훈련 모델 설정값을 로드하고 저장하는 것을 지원하는 기본 메소드를 구현하였습니다. @@ -59,10 +59,10 @@ rendered properly in your Markdown viewer. - push_to_hub - all -## Pushing to the Hub +## 허브에 저장하기 [[autodoc]] utils.PushToHubMixin -## Sharded checkpoints +## 공유된 체크포인트 [[autodoc]] modeling_utils.load_sharded_checkpoint From 4ed3e2ce3b37538fcc5bca415a5cf764b405d224 Mon Sep 17 00:00:00 2001 From: Sungmin Oh Date: Fri, 20 Sep 2024 11:55:59 +0900 Subject: [PATCH 3/3] docs: ko: main_classes/model.md --- docs/source/ko/_toctree.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/ko/_toctree.yml b/docs/source/ko/_toctree.yml index eafd389994ad52..e20a3bc35d6b65 100644 --- a/docs/source/ko/_toctree.yml +++ b/docs/source/ko/_toctree.yml @@ -284,8 +284,8 @@ title: (번역중) Keras callbacks - local: in_translation title: (번역중) Logging - - local: in_translation - title: (번역중) Models + - local: main_classes/model + title: Models - local: in_translation title: (번역중) Text Generation - local: in_translation