/Ko-Gemma

Apache License 2.0Apache-2.0

Ko-Gemma

Huggingface Huggingface

logo

Ko-Gemma: Korean Gemma

| Korean | English |

What's New

  • February 2024: [πŸš€ Model Release πŸš€] We are excited to announce the release of our initial models for the Korean language processing community! Check them out:

Quick start

from transformers import AutoTokenizer, pipeline
import torch

model_and_tokenizer_path = "nlpai-lab/ko-gemma-7b-v1"

tokenizer = AutoTokenizer.from_pretrained(model_and_tokenizer_path)
pipeline = pipeline(
    "text-generation",
    model=model_and_tokenizer_path,
    tokenizer=tokenizer,
    model_kwargs={"torch_dtype": torch.bfloat16},
    device="cuda",
)

tokenizer = AutoTokenizer.from_pretrained(model_and_tokenizer_path)
messages = [
    {"role": "user", 
     "content": "μ΄μˆœμ‹  μž₯ꡰ에 λŒ€ν•΄ μ„€λͺ…ν•΄μ£Όμ„Έμš”."},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) # Don't use `pipeline.tokenizer`
print(prompt) # <bos><start_of_turn>user\nμ΄μˆœμ‹  μž₯ꡰ에 λŒ€ν•΄ μ„€λͺ…ν•΄μ£Όμ„Έμš”.<end_of_turn>\n<start_of_turn>model\n

outputs = pipeline(
    prompt,
    max_new_tokens=4096,
    add_special_tokens=True
)
print(outputs[0]["generated_text"][len(prompt):]) # 'μ΄μˆœμ‹  μž₯ꡰ은 μ‘°μ„  μ‹œλŒ€μ˜ λŒ€ν‘œμ μΈ ꡰ사 μ§€λ„μžμ΄μž μ „λž΅κ°€μž…λ‹ˆλ‹€. κ·ΈλŠ” μ‘°μ„  μ‹œλŒ€μ˜ μˆ˜λ„μΈ ν•œμ–‘μ—μ„œ νƒœμ–΄λ‚¬μœΌλ©°, μ‘°μ„  μ‹œλŒ€ κ΅°λŒ€μ—μ„œ λ‹€μ–‘ν•œ μ§€λ„μžλ‘œ ν™œλ™ν–ˆμŠ΅λ‹ˆλ‹€.\n\nμ΄μˆœμ‹  μž₯ꡰ의 κ°€μž₯ μ£Όλͺ©ν•  λ§Œν•œ 업적 쀑 ν•˜λ‚˜λŠ” 1592λ…„λΆ€ν„° 1598λ…„κΉŒμ§€ 일본이 쑰선을 μΉ¨κ³΅ν•œ 일본 μ „μŸμ—μ„œμ˜ ν™œλ™μž…λ‹ˆλ‹€. 이 μ „μŸμ—μ„œ μ΄μˆœμ‹  μž₯ꡰ은 μ‘°μ„  κ΅°λŒ€μ˜ μ „λž΅μ μΈ μ§€λ„μžλ‘œ ν™œλ™ν•˜λ©° 일본의 μΉ¨λž΅μ— μ €ν•­ν•˜λŠ” 데 큰 역할을 ν–ˆμŠ΅λ‹ˆλ‹€.\n\nμ΄μˆœμ‹  μž₯ꡰ은 μ „νˆ¬μ—μ„œμ˜ μš©κΈ°μ™€ μ „μˆ μ  μ§€μ„±μœΌλ‘œ 유λͺ…ν–ˆμŠ΅λ‹ˆλ‹€. κ·ΈλŠ” μ „νˆ¬μ—μ„œ μ „μˆ μ μΈ 사고λ₯Ό λ°œνœ˜ν•˜κ³  적의 약점을 κ³΅κ²©ν•˜λŠ” κ²ƒμœΌλ‘œ 유λͺ…ν–ˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ κ·ΈλŠ” μ‘°μ„  κ΅°λŒ€μ˜ μ „λ ₯을 κ³ μ·¨ν•˜κ³  μ „νˆ¬μ—μ„œ μŠΉλ¦¬ν•˜λŠ” 데 도움이 λ˜λŠ” μ—°μ„€κ³Ό 격렀의 말을 μ „ν•˜λŠ” κ²ƒμœΌλ‘œλ„ 유λͺ…ν–ˆμŠ΅λ‹ˆλ‹€.\n\nμ΄μˆœμ‹  μž₯ꡰ은 μ „μŸμ΄ λλ‚œ 후에도 μ‘°μ„  κ΅°λŒ€μ—μ„œ 계속 ν™œλ™ν•˜λ©° μ‘°μ„  κ΅°λŒ€μ˜ μ§€λ„μžλ‘œ ν™œλ™ν–ˆμŠ΅λ‹ˆλ‹€. κ·ΈλŠ” μ‘°μ„  κ΅°λŒ€μ˜ μ „λ ₯을 μœ μ§€ν•˜κ³  μ‘°μ„ μ˜ μ•ˆλ³΄λ₯Ό μ§€ν‚€λŠ” 데 큰 역할을 ν–ˆμŠ΅λ‹ˆλ‹€.\n\nμ΄μˆœμ‹  μž₯ꡰ은 μ‘°μ„  μ‹œλŒ€μ˜ λŒ€ν‘œμ μΈ ꡰ사 μ§€λ„μžμ΄μž μ „λž΅κ°€λ‘œ κΈ°μ–΅λ˜κ³  μžˆμŠ΅λ‹ˆλ‹€. 그의 μš©κΈ°μ™€ μ „μˆ μ  지성, 그리고 μ‘°μ„  κ΅°λŒ€μ˜ μ „λ ₯을 μœ μ§€ν•˜λŠ” 데 κΈ°μ—¬ν•œ κ³΅λ‘œλŠ” κ·Έλ₯Ό 전섀적인 인물둜 λ§Œλ“€μ—ˆμŠ΅λ‹ˆλ‹€.'

License

License Copyright 2024 DeepMind Technologies Limited

This code is 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.