# πŸ€— KoLlama-Empathy πŸ’ KoLlama-EmpathyλŠ” Llama-3.1-8Bλ₯Ό ν•œκ΅­μ–΄ 곡감 λŒ€ν™” λ°μ΄ν„°μ…‹μœΌλ‘œ νŒŒμΈνŠœλ‹ν•œ μ–Έμ–΄ λͺ¨λΈμž…λ‹ˆλ‹€. 이 λͺ¨λΈμ€ μ‚¬μš©μžμ˜ 감정을 μ΄ν•΄ν•˜κ³  κ³΅κ°ν•˜λŠ” λŒ€ν™”λ₯Ό μƒμ„±ν•˜λŠ” 것을 λͺ©ν‘œλ‘œ ν•©λ‹ˆλ‹€. πŸ’­βœ¨ ## πŸ“‹ Model Description - πŸ¦™ Base Model: unsloth/Meta-Llama-3.1-8B - πŸ“š Dataset: [AI Hub κ°μ„±λŒ€ν™” λ§λ­‰μΉ˜](https://www.aihub.or.kr/aihubdata/data/view.do?dataSetSn=71305) - πŸ”§ Training Method: LoRA (r=16, alpha=16) ## βš™οΈ Training Configuration - πŸ“ Max Sequence Length: 2048 - πŸ“¦ Batch Size: 128 - πŸ”„ Gradient Accumulation Steps: 4 - πŸ“ˆ Learning Rate: 2e-4 - πŸ› οΈ Optimizer: AdamW 8bit - πŸ’Ύ Quantization: GGUF q8_0 - πŸ” Training Epochs: 3 TIP: λ°μ΄ν„°μ˜ ν¬κΈ°λ‚˜ Epoch을 늘리면 μ’€ 더 쒋은 κ²°κ³Όλ₯Ό κ°€μ Έμ˜¬ 수 μžˆμ„κ±°μ—μš”! ## πŸ’» Usage λͺ¨λΈμ„ μ‚¬μš©ν•˜λŠ” 방법은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€: ```python from unsloth import FastLanguageModel model, tokenizer = FastLanguageModel.from_pretrained("byeolki/KoLlama-Empathy", load_in_4bit=True) alpaca_prompt = """μ•„λž˜λŠ” μž‘μ—…μ„ μ„€λͺ…ν•˜λŠ” μ§€μ‹œμ‚¬ν•­μž…λ‹ˆλ‹€. μž…λ ₯된 λ‚΄μš©μ„ λ°”νƒ•μœΌλ‘œ μ μ ˆν•œ 응닡을 μž‘μ„±ν•˜μ„Έμš”. ### μ§€μ‹œμ‚¬ν•­: μž…λ ₯에 λŒ€ν•΄μ„œ κ³΅κ°ν•΄μ£Όμ„Έμš”. ### μž…λ ₯: {input} ### 응닡: """ FastLanguageModel.for_inference(model) input_text = "μ•ˆλ…•ν•˜μ„Έμš”. μ € 였늘 기뢄이 μ•ˆ μ’‹μ•„μš”." inputs = tokenizer([alpaca_prompt.format(input=input_text)], return_tensors="pt").to("cuda") outputs = model.generate(**inputs, max_new_tokens=64, use_cache=True) generated_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0] print(generated_text) ``` ## πŸ’¬ Example Conversations πŸ‘€ User: λ‚˜ 였늘 μ†μƒν•œ 일이 μžˆμ—ˆμ–΄. πŸ€– Assistant: 무슨 일인데 그래? 기뢄이 많이 μ•ˆ μ’‹μ•˜λ‚˜ 보넀. πŸ‘€ User: λ‚˜ 살이 λ„ˆλ¬΄ 많이 찐거 κ°™μ•„. πŸ€– Assistant: λ„€κ°€ 살이 많이 μͺ μ„œ κ·ΈλŸ°μ§€ 자꾸 슀트레슀λ₯Ό λ°›κ³  μžˆλŠ”κ±° κ°™μ•„. ## βš–οΈ License MIT License Copyright (c) 2024 byeolki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.