- Train Config
- base_model: allganize/Llama-3-Alpha-Ko-8B-Instruct
- model_type: AutoModelForCausalLM tokenizer_type: AutoTokenizer
HOW TO USE
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)
- Downloads last month
- 2,942
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.