Edit model card

Llama3-Chat_Vector-kor_Instruct

I have implemented a Korean LLAMA3 model referring to the models created by Beomi

Chat-Vector Paper(https://arxiv.org/abs/2310.04799)

Reference Models:

  1. meta-llama/Meta-Llama-3-8B(https://huggingface.co/meta-llama/Meta-Llama-3-8B)
  2. meta-llama/Meta-Llama-3-8B-Instruct(https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct)
  3. beomi/Llama-3-KoEn-8B(https://huggingface.co/beomi/Llama-3-KoEn-8B)

Citation

@misc {Llama3-Chat_Vector-kor_Instruct,
    author       = { {nebchi} },
    title        = { Llama3-Chat_Vector-kor_Instruct },
    year         = 2024,
    url          = { https://huggingface.co/nebchi/Llama3-Chat_Vector-kor_llava },
    publisher    = { Hugging Face }
}

Running the model on GPU

from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, TextStreamer
import torch

tokenizer = AutoTokenizer.from_pretrained(
    "nebchi/Llama3-Chat_Vector-kor",
)

model = AutoModelForCausalLM.from_pretrained(
    "nebchi/Llama3-Chat_Vector-kor",
    torch_dtype=torch.bfloat16,
    device_map='auto',
)
streamer = TextStreamer(tokenizer)

messages = [
    {"role": "system", "content": "당신은 인곡지λŠ₯ μ–΄μ‹œμŠ€ν„΄νŠΈμž…λ‹ˆλ‹€. λ¬»λŠ” 말에 μΉœμ ˆν•˜κ³  μ •ν™•ν•˜κ²Œ λ‹΅λ³€ν•˜μ„Έμš”."},
    {"role": "user", "content": "λŒ€ν•œλ―Όκ΅­μ˜ μˆ˜λ„μ— λŒ€ν•΄ μ•Œλ €μ€˜"},
]

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|>")
]

outputs = model.generate(
    input_ids,
    max_new_tokens=512,
    eos_token_id=terminators,
    do_sample=False,
    repetition_penalty=1.05,
    streamer = streamer
)
response = outputs[0][input_ids.shape[-1]:]
print(tokenizer.decode(response, skip_special_tokens=True))

results

λŒ€ν•œλ―Όκ΅­μ˜ μˆ˜λ„λŠ” μ„œμšΈνŠΉλ³„μ‹œμž…λ‹ˆλ‹€.
μ„œμšΈνŠΉλ³„μ‹œμ—λŠ” μ²­μ™€λŒ€, κ΅­νšŒμ˜μ‚¬λ‹Ή, λŒ€λ²•μ› λ“± λŒ€ν•œλ―Όκ΅­μ˜ μ£Όμš” 정뢀기관이 μœ„μΉ˜ν•΄ μžˆμŠ΅λ‹ˆλ‹€.
λ˜ν•œ μ„œμšΈμ‹œλŠ” λŒ€ν•œλ―Όκ΅­μ˜ 경제, λ¬Έν™”, ꡐ윑, κ΅ν†΅μ˜ μ€‘μ‹¬μ§€λ‘œμ¨ λŒ€ν•œλ―Όκ΅­μ˜ μˆ˜λ„μ΄μž λŒ€ν‘œ λ„μ‹œμž…λ‹ˆλ‹€.μ œκ°€ 도움이 λ˜μ—ˆκΈΈ λ°”λžλ‹ˆλ‹€. 더 κΆκΈˆν•œ 점이 μžˆμœΌμ‹œλ©΄ μ–Έμ œλ“ μ§€ λ¬Όμ–΄λ³΄μ„Έμš”!
Downloads last month
0
Safetensors
Model size
8.03B params
Tensor type
BF16
Β·
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.