File size: 3,229 Bytes
744a636 909c414 744a636 |
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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
---
library_name: transformers
tags:
- unsloth
- trl
- sft
datasets:
- mintaeng/llm_futsaldata_yo
license: apache-2.0
language:
- ko
---
# FUT FUT CHAT BOT
- μ€νμμ€ λͺ¨λΈμ LLM fine tuning κ³Ό RAG λ₯Ό μ μ©
- νμ΄μ λν κ΄μ¬μ΄ λμμ§λ©΄μ μμ λλΉ μ
λ¬Έμλ₯Ό μν μ 보 μ 곡 μλΉμ€κ° νμνλ€κ³ λκ»΄ μ μνκ² λ¨
- νμ΄ νλ«νΌμ μ¬μ©λλ νμ΄ μ 보 λμ°λ―Έ μ±λ΄
- 'ν΄μ체'λ‘ λ΅νλ©° λ¬Έμ₯ λμ 'μΌλ§λ μ§ λ¬Όμ΄λ³΄μΈμ~ νν~!' μ μΆλ ₯ν¨
## HOW TO USE
``` python
#!pip install transformers==4.40.0 accelerate
import os
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = 'Dongwookss/small_fut_final'
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model.eval()
```
**Query**
```python
from transformers import TextStreamer
PROMPT = '''Below is an instruction that describes a task. Write a response that appropriately completes the request.
μ μνλ contextμμλ§ λλ΅νκ³ contextμ μλ λ΄μ©μ λͺ¨λ₯΄κ² λ€κ³ λλ΅ν΄'''
messages = [
{"role": "system", "content": f"{PROMPT}"},
{"role": "user", "content": f"{instruction}"}
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
terminators = [
tokenizer.eos_token_id,
tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
text_streamer = TextStreamer(tokenizer)
_ = model.generate(
input_ids,
max_new_tokens=4096,
eos_token_id=terminators,
do_sample=True,
streamer = text_streamer,
temperature=0.6,
top_p=0.9,
repetition_penalty = 1.1
)
```
## Model Details
### Model Description
This is the model card of a π€ transformers model that has been pushed on the Hub. This model card has been automatically generated.
- **Developed by:** Dongwookss
- **Model type:** text generation
- **Language(s) (NLP):** Korean
- **Finetuned from model :** HuggingFaceH4/zephyr-7b-beta
### Data
https://huggingface.co/datasets/Dongwookss/q_a_korean_futsal
νμ΅ λ°μ΄ν°μ
μ nlpai-lab/databricks-dolly-15k-ko λ₯Ό λ² μ΄μ€λ‘ μΆκ°, ꡬμΆ, μ μ²λ¦¬ μ§νν 2.33k λ°μ΄ν°λ‘ νλνμμ΅λλ€.
λ°μ΄ν°μ
μ instruction, input, output μΌλ‘ ꡬμ±λμ΄ μμΌλ©° tuning λͺ©νμ λ§κ² λ§ν¬ μμ νμμ΅λλ€.
λλ©μΈ μ 보μ λν λ°μ΄ν° μΆκ°νμμ΅λλ€.
## Training & Result
### Training Procedure
LoRAμ SFT Trainer λ°©μμ μ¬μ©νμμ΅λλ€.
#### Training Hyperparameters
- **Training regime:** bf16 mixed precision
```
r=32,
lora_alpha=64, # QLoRA : alpha = r/2 // LoRA : alpha =r*2
lora_dropout=0.05,
target_modules=[
"q_proj",
"k_proj",
"v_proj",
"o_proj",
"gate_proj",
"up_proj",
"down_proj",
], # νκ² λͺ¨λ
```
### Result
https://github.com/lucide99/Chatbot_FutFut
<!-- ## Bias, Risks, and Limitations -->
<!-- ## Model Examination [optional] -->
## Environment
L4 GPU
<!-- ## contributors -->
|