Downloads · 30 days
17
0% of all-time downloads
MRAIRR/minillama3_8b_all
minillama3_8b_all is a text generation model from MRAIRR. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
- Train Config - basemodel: allganize/Llama-3-Alpha-Ko-8B-Instruct - modeltype: AutoModelForCausalLM tokenizertype: AutoTokenizer
Downloads · 30 days
17
0% of all-time downloads
All-time downloads
30.2K
Public
Repo size
32.1 GB
Likes
0
Public
Click a slice to open those files.
.bin16.1 GB · 100%
From the Hugging Face model README
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "MRAIRR/minillama3_8b_all"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
PROMPT_TEMPLATE = """
# 지시:
당신은 인공지능 어시스턴트입니다. 사용자가 묻는 말에 친절하고 정확하게 답변하세요.
"""
messages = [
{"role": "system", "content":PROMPT_TEMPLATE},
{"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=256,
temperature = 0.3,
eos_token_id=terminators,
do_sample=True,
repetition_penalty=1.05,
)
response = outputs[0][input_ids.shape[-1]:]
response_text = tokenizer.decode(response, skip_special_tokens=True)
completion = '\n'.join(response_text.split("."))
print(completion)