ChatSKKU5.8B / README.md
jojo0217's picture
Update README.md
16c6a3a
|
raw
history blame
1.57 kB
metadata
license: apache-2.0
datasets:
  - jojo0217/korean_rlhf_dataset
language:
  - ko

μ„±κ· κ΄€λŒ€ν•™κ΅ μ‚°ν•™ν˜‘λ ₯ κ³Όμ •μ—μ„œ λ§Œλ“  ν…ŒμŠ€νŠΈ λͺ¨λΈμž…λ‹ˆλ‹€.
ν•™μŠ΅ λ°μ΄ν„°μ˜ μ°Έκ³  λͺ¨λΈμ΄λΌκ³  μƒκ°ν•˜μ‹œλ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.
κΈ°μ‘΄ 10만 7천개의 데이터 + 2천개 μΌμƒλŒ€ν™” μΆ”κ°€ 데이터λ₯Ό μ²¨κ°€ν•˜μ—¬ ν•™μŠ΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

μΈ‘μ •ν•œ kobest μ μˆ˜λŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.
score

ν…ŒμŠ€νŠΈ μ½”λ“œλŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer

model_name="jojo0217/ChatSKKU5.8B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
            model_name,
            device_map="auto",
            load_in_8bit=True,#λ§Œμ•½ μ–‘μžν™” 끄고 μ‹Άλ‹€λ©΄ false
        )
tokenizer = AutoTokenizer.from_pretrained(model_name)
pipe = pipeline(
            "text-generation",
            model=model,
            tokenizer=model_name,
            device_map="auto"
        )

def answer(message):
  prompt=f"μ•„λž˜λŠ” μž‘μ—…μ„ μ„€λͺ…ν•˜λŠ” λͺ…λ Ήμ–΄μž…λ‹ˆλ‹€. μš”μ²­μ„ 적절히 μ™„λ£Œν•˜λŠ” 응닡을 μž‘μ„±ν•˜μ„Έμš”.\n\n### λͺ…λ Ήμ–΄:\n{message}"
  ans = pipe(
        prompt + "\n\n### 응닡:",
        do_sample=True,
        max_new_tokens=512,
        temperature=0.9,
        num_beams = 1,
        repetition_penalty = 1.0,
        return_full_text=False,
        eos_token_id=2,
    )
  msg = ans[0]["generated_text"]
  return msg
answer('μ„±κ· κ΄€λŒ€ν•™κ΅μ—λŒ€ν•΄ μ•Œλ €μ€˜')