| <!--Copyright 2022 The HuggingFace Team. All rights reserved. | |
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | |
| an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | |
| specific language governing permissions and limitations under the License. | |
| β οΈ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be | |
| rendered properly in your Markdown viewer. | |
| --> | |
| # μμ± [[generation]] | |
| κ° νλ μμν¬μλ ν΄λΉνλ `GenerationMixin` ν΄λμ€μμ ꡬνλ ν μ€νΈ μμ±μ μν generate λ©μλκ° μμ΅λλ€: | |
| - PyTorchμμλ [`~generation.GenerationMixin.generate`]κ° [`~generation.GenerationMixin`]μ ꡬνλμ΄ μμ΅λλ€. | |
| - TensorFlowμμλ [`~generation.TFGenerationMixin.generate`]κ° [`~generation.TFGenerationMixin`]μ ꡬνλμ΄ μμ΅λλ€. | |
| - Flax/JAXμμλ [`~generation.FlaxGenerationMixin.generate`]κ° [`~generation.FlaxGenerationMixin`]μ ꡬνλμ΄ μμ΅λλ€. | |
| μ¬μ©νλ νλ μμν¬μ μκ΄μμ΄, generate λ©μλλ [`~generation.GenerationConfig`] ν΄λμ€ μΈμ€ν΄μ€λ‘ λ§€κ°λ³μν ν μ μμ΅λλ€. generate λ©μλμ λμμ μ μ΄νλ λͺ¨λ μμ± λ§€κ°λ³μ λͺ©λ‘μ νμΈνλ €λ©΄ μ΄ ν΄λμ€λ₯Ό μ°Έμ‘°νμΈμ. | |
| λͺ¨λΈμ μμ± μ€μ μ μ΄λ»κ² νμΈνκ³ , κΈ°λ³Έκ°μ΄ 무μμΈμ§, λ§€κ°λ³μλ₯Ό μ΄λ»κ² μμλ‘ λ³κ²½νλμ§, κ·Έλ¦¬κ³ μ¬μ©μ μ§μ μμ± μ€μ μ λ§λ€κ³ μ μ₯νλ λ°©λ²μ λ°°μ°λ €λ©΄ [ν μ€νΈ μμ± μ λ΅ κ°μ΄λ](../generation_strategies)λ₯Ό μ°Έμ‘°νμΈμ. μ΄ κ°μ΄λλ ν ν° μ€νΈλ¦¬λ°κ³Ό κ°μ κ΄λ ¨ κΈ°λ₯μ μ¬μ©νλ λ°©λ²λ μ€λͺ ν©λλ€. | |
| ## GenerationConfig [[transformers.GenerationConfig]] | |
| [[autodoc]] generation.GenerationConfig | |
| - from_pretrained | |
| - from_model_config | |
| - save_pretrained | |
| - update | |
| - validate | |
| - get_generation_mode | |
| [[autodoc]] generation.WatermarkingConfig | |
| ## GenerationMixin [[transformers.GenerationMixin]] | |
| [[autodoc]] generation.GenerationMixin | |
| - generate | |
| - compute_transition_scores | |