File size: 3,091 Bytes
17c6d62 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
<!--Copyright 2024 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.
-->
# Gemma2 [[gemma2]]
## κ°μ [[overview]]
Gemma2 λͺ¨λΈμ Googleμ Gemma2 νμ΄ μμ±ν [Gemma2: Open Models Based on Gemini Technology and Research](https://blog.google/technology/developers/google-gemma-2/)μμ μ μλμμ΅λλ€.
νλΌλ―Έν° ν¬κΈ°κ° κ°κ° 90μ΅(9B)κ³Ό 270μ΅(27B)μΈ λ κ°μ§ Gemma2 λͺ¨λΈμ΄ μΆμλμμ΅λλ€.
λΈλ‘κ·Έ κ²μλ¬Όμ μ΄λ‘μ λ€μκ³Ό κ°μ΅λλ€:
*μ΄μ μ°λ¦¬λ μ μΈκ³μ μ°κ΅¬μμ κ°λ°μλ€μκ² Gemma 2λ₯Ό 곡μμ μΌλ‘ μΆμν©λλ€. 90μ΅(9B)κ³Ό 270μ΅(27B) νλΌλ―Έν° ν¬κΈ°λ‘ μ 곡λλ Gemma 2λ 1μΈλλ³΄λ€ λ λμ μ±λ₯κ³Ό μΆλ‘ ν¨μ¨μ±μ μ 곡νλ©°, μλΉν μμ μ± ν₯μμ ν¬ν¨νκ³ μμ΅λλ€. μ¬μ€ 270μ΅ κ·λͺ¨μ λͺ¨λΈμ ν¬κΈ°κ° λ λ°° μ΄μμΈ λͺ¨λΈκ³Ό λΉκ΅ν΄λ κ²½μλ ₯ μλ λμμ μ 곡νλ©°, μ΄λ μλ
12μκΉμ§λ§ ν΄λ λ
μ λͺ¨λΈμμλ§ κ°λ₯νλ μ±λ₯μ μ 곡ν©λλ€.*
ν:
- μλ³Έ 체ν¬ν¬μΈνΈλ λ³ν μ€ν¬λ¦½νΈ `src/transformers/models/Gemma2/convert_Gemma2_weights_to_hf.py`λ₯Ό μ¬μ©νμ¬ λ³νν μ μμ΅λλ€.
<Tip warning={true}>
- Gemma2λ λ§€ λ λ²μ§Έ λ μ΄μ΄λ§λ€ μ¬λΌμ΄λ© μλμ° μ΄ν
μ
μ μ¬μ©νλ―λ‘ [`~DynamicCache`] λλ ν
μμ ννκ³Ό κ°μ μΌλ°μ μΈ kv μΊμ±μλ μ ν©νμ§ μμ΅λλ€. Gemma2μ forward νΈμΆμμ μΊμ±μ νμ±ννλ €λ©΄ [`~HybridCache`] μΈμ€ν΄μ€λ₯Ό μ΄κΈ°ννκ³ μ΄λ₯Ό `past_key_values`λ‘ forward νΈμΆμ μ λ¬ν΄μΌ ν©λλ€. λν `past_key_values`μ μ΄λ―Έ μ΄μ μ ν€μ κ°μ΄ ν¬ν¨λμ΄ μλ€λ©΄ `cache_position`λ μ€λΉν΄μΌ ν©λλ€.
</Tip>
μ΄ λͺ¨λΈμ [Arthur Zucker](https://huggingface.co/ArthurZ), [Pedro Cuenca](https://huggingface.co/pcuenq), [Tom Arsen]()μ΄ κΈ°μ¬νμ΅λλ€.
## Gemma2Config [[transformers.Gemma2Config]]
[[autodoc]] Gemma2Config
## Gemma2Model [[transformers.Gemma2Model]]
[[autodoc]] Gemma2Model
- forward
## Gemma2ForCausalLM [[transformers.Gemma2ForCausalLM]]
[[autodoc]] Gemma2ForCausalLM
- forward
## Gemma2ForSequenceClassification [[transformers.Gemma2ForSequenceClassification]]
[[autodoc]] Gemma2ForSequenceClassification
- forward
## Gemma2ForTokenClassification [[transformers.Gemma2ForTokenClassification]]
[[autodoc]] Gemma2ForTokenClassification
- forward |