--- language: - ko license: apache-2.0 pipeline_tag: text-generation --- # Kor-Gemma-2B > Update @ 2024.05.10: First release of gemma-ko This model card corresponds to the 2B-it version of the **Gemma-Ko** model. **Resources and Technical Documentation**: * [Original Gemma-2b-it](https://huggingface.co/google/gemma-2b-it) **Citation** ```bibtex @misc {gemma-summary-v01 , author = { {frcp,nebchi,pepperonipizza} }, title = { gemma-summary-v01 }, year = 2024, url = { https://huggingface.co/cpm-ai/gemma-ko-v01 }, publisher = { Hugging Face } } ``` **Model Developers**: frcp, nebchi, pepperonipizza ## Model Information I trained a language model using a dataset of 363,000 Korean text samples. ### Description It has been trained with a large amount of Korean tokens compared to other LLMs, enabling it to generate high-quality Korean text. Additionally, it shows improved performance with less data compared to other LLM models. #### Running the model on a single / multi GPU ```python from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cpm-ai/gemma-ko-v01") model = AutoModelForCausalLM.from_pretrained("cpm-ai/gemma-ko-v01", device_map="auto") prompt = """요약 할 문장 : [안녕하세요 생방송 토론카페입니다. 오늘 성탄절 전야 생방송으로 진행해 드리고 있는데요. 특집으로 저희가 분위기도 많이 바꿔봤고 또 오늘은 사랑의 계절이니만큼 나눔에 대해서 이야기 해볼까 합니다. 평소 생활 속의 나눔을 늘 실천하고 계시는 네 분 모시고 이야기 나눠보도록 하겠습니다 그럼 네 분 소개해 드리겠습니다 들어오시죠. 네 오늘 생방송 토론 카페에서는 나눔의 의미에 대해서 이야기 나눠볼까 하는데요. 어 전야제 이제 내일이면 크리스마스고 지금 아홉 시 십삼 분 지나고 있거든요 산타클로스 할아버지가 상당히 바빠진 그런 시간입니다. 이럴 때 가족과 또는 친지들과 함께 보내셔야 될 이 귀한 시간 내 주셔서 오신 네 분 먼저 소개해 드리도록 하겠습니다. 먼저 &party-name1&의 위원입니다. 안녕하세요. 그리고 숭실대학교 사회사업학과의 교수입니다. 안녕하세요. 그리고 아름다운 재단의 상임이사 입니다. 안녕하세요. 그리고 사랑의 장기기증운동본부에 국장님이십니다. 안녕하세요. 이렇게 나와 주셔서 다시 한번 감사드리구요. 그리고 오늘 특별히 저희 토론 카페에는 용산구 자원봉사 센터에서 봉사활동을 늘 하시는 분들이 나와주셨습니다. 오늘 나와주신 분들 다시 한번 환영하고 진심으로 감사드립니다. 늘 이런 얘기를 하죠 우리사회에는 아직도 공동체 의식이 부족하다 나눔의 의식이 부족하다 기부 문화가 정착돼 있지 않다 그런 얘기들을 많이 하는데요. 어떻게 하면 그러한 따뜻한 우리들의 마음을 더 키우고 더 나눌 수 있고 또 그런 것을 어떠한 제도적 장치로 잘 보완해 나갈 수 있을까 그런 문제들을 하나하나 이야기 나눠보도록 하겠습니다 나눔이 도대체 왜 필요한지 그리고 원론적인 얘기 겠죠. 그것부터 한번 얘기를 한번 해 볼까 합니다 먼저 변호사님께서 얘기해 주시겠습니까. 자기 행복하기 위해서죠. {laughing} 역설적으로 들립니다. 사실 기부라든지 나눔이라는 게 자기 주머니에서 돈이 나가니까 자기한테 손해가 될 것 같은데 실제로 나눠본 사람만 압니다. {laughing} 이게 얼마나 자기가 스스로 행복해지는지 그래서 요새 뭐 나눔기부중독이라는 말도 있구요. 또 저희들이 이렇게 서양에 뭐 이렇게 모금에 관한 책을 읽어보면 기부 해 본 사람한테 가서 또 달라고 해라 이게 모금하는 사람이 첫 번째 원칙으로 얘기해요. 그 얘기는 무슨 얘기냐면 해본 사람이 즐거우니까 또한 가능성이 많다는 거지요 아마 이건 해보셔야 이거 제가 아무리 말씀드려도 소용없구요. 실제 나눠보셔야 그 기쁨 즐거움을 아시게 됩니다. 결국에는 자기한테 돌아온다 라고 하는 것이 서양 사람들에게 많이 팽배했는데 장기기증 같은 경우에도 내가 기증을 하면 음 그것이 결국은 나한테 돌아온다는 그 이유가 뭐냐 하면 내가 언제든지 환자가 되었을 때 사회 전반적으로 그렇게 기증하는 그 문화가 확산되면 내가 환자가 됐을 때 그것이 결국 나한테 혜택이 돌아온다 라고 해서 스페인 같은 경우에는 백만 명당 삼십사 명으로 전 세계적으로 가장 많이 기증을 하고 있는데 그런 의식이 결국은 내게 돌아오는 것이다라고 하는 의식이 팽배하기 때문에 그렇게 된다고해요. 백만 명당 삼십사 명이라는 것은 실제 기증하는 예 숫자가 수치겠죠 그게 이루어지려면 기증 서약은 굉장히 더 많은 사람들이 하겠네요. ]""" formatted_prompt = f"Instruction: {prompt}\n output:" outputs = pipe_finetuned( formatted_prompt, temperature=0.1, top_k=50, top_p=0.95, repetition_penalty=1.2, add_special_tokens=True, streamer = streamer ) print(outputs[0]["generated_text"][len(formatted_prompt):]) ``` ### results ```python 제목: 나눔의 의미와 필요성에 대한 토론 1. 나눔의 의미와 중요성 - 나눔은 특정 날짜에, 특정 사람들과 함께 하는 시간을 의미한다. - 특별히, 크리스마스와 산타클로스를 포함한 일부 날짜에는 가족과 친지들과 함께 나눔을 할 수 있다. - 나눔은 가족과 친지들과 함께 보내는 시간이라는 점에서 중요하다. 2. 나눔의 필요성 - 공동체 의식이 부족하며, 기부 문화가 정착되지 않았다. - 나눔의 의식이 부족하여, 기부 문화가 잘 보완되지 않았다. 3. 나눔의 원론적 얘기 - 나눔은 기부로부터 얻는 것이 아니라, 기부를 통해 얻는 것이 아니라, 기부를 통해 얻는 것이 아니라, 기부를 통해 얻는 것이라는 의식이 필요하다. - 나눔의 의식을 키우고 나눌 수 있도록 제도적 장치가 필요하다. 4. 나눔의 의식에 대한 논의 - 변호사는 나눔이 자기 행복을 위한 것이라는 의견을 제시했다. - 나눔이 기부로부터 얻는 것이라는 의견도 제시되었다. - 나눔이 결국 환자가 되는 것이라는 의견도 제시되었다. ``` ### Inputs and outputs * **Input:** Text string, such as a question, a prompt, or a document to be summarized. * **Output:** Generated Korea text in response to the input, such an answer to a question, or a summary of a minutes. ### Software Training was done using QLoRA ## Usage and Limitations These models have certain limitations that users should be aware of. ### Intended Usage Open Large Language Models (LLMs) have a wide range of applications across various industries and domains. The following list of potential uses is not comprehensive. The purpose of this list is to provide contextual information about the possible use-cases that the model creators considered as part of model training and development. * Content Creation and Communication * Text Generation: These models can be used to generate creative text formats such as poems, scripts, code, marketing copy, and email drafts. * Research and Education * Natural Language Processing (NLP) Research: These models can serve as a foundation for researchers to experiment with NLP techniques, develop algorithms, and contribute to the advancement of the field. * Language Learning Tools: Support interactive language learning experiences, aiding in grammar correction or providing writing practice. * Knowledge Exploration: Assist researchers in exploring large bodies of text by generating summaries or answering questions about specific topics. ### Limitations * Training Data * The quality and diversity of the training data significantly influence the model's capabilities. Biases or gaps in the training data can lead to limitations in the model's responses. * The scope of the training dataset determines the subject areas the model can handle effectively. * Context and Task Complexity * LLMs are better at tasks that can be framed with clear prompts and instructions. Open-ended or highly complex tasks might be challenging. * A model's performance can be influenced by the amount of context provided (longer context generally leads to better outputs, up to a certain point). * Language Ambiguity and Nuance * Natural language is inherently complex. LLMs might struggle to grasp subtle nuances, sarcasm, or figurative language. * Factual Accuracy * LLMs generate responses based on information they learned from their training datasets, but they are not knowledge bases. They may generate incorrect or outdated factual statements. * Common Sense * LLMs rely on statistical patterns in language. They might lack the ability to apply common sense reasoning in certain situations. ### Ethical Considerations and Risks The development of large language models (LLMs) raises several ethical concerns. In creating an open model, we have carefully considered the following: * Bias and Fairness * LLMs trained on large-scale, real-world text data can reflect socio-cultural biases embedded in the training material. These models underwent careful scrutiny, input data pre-processing described and posterior evaluations reported in this card. * Misinformation and Misuse * LLMs can be misused to generate text that is false, misleading, or harmful. * Guidelines are provided for responsible use with the model, see the [Responsible Generative AI Toolkit](http://ai.google.dev/gemma/responsible). * Transparency and Accountability: * This model card summarizes details on the models' architecture, capabilities, limitations, and evaluation processes. * A responsibly developed open model offers the opportunity to share innovation by making LLM technology accessible to developers and researchers across the AI ecosystem. Risks identified and mitigations: * Perpetuation of biases: It's encouraged to perform continuous monitoring (using evaluation metrics, human review) and the exploration of de-biasing techniques during model training, fine-tuning, and other use cases. * Generation of harmful content: Mechanisms and guidelines for content safety are essential. Developers are encouraged to exercise caution and implement appropriate content safety safeguards based on their specific product policies and application use cases. * Misuse for malicious purposes: Technical limitations and developer and end-user education can help mitigate against malicious applications of LLMs. Educational resources and reporting mechanisms for users to flag misuse are provided. Prohibited uses of Gemma models are outlined in the [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy). * Privacy violations: Models were trained on data filtered for removal of PII (Personally Identifiable Information). Developers are encouraged to adhere to privacy regulations with privacy-preserving techniques.