--- license: apache-2.0 --- - Train Config - base_model: allganize/Llama-3-Alpha-Ko-8B-Instruct - model_type: AutoModelForCausalLM tokenizer_type: AutoTokenizer ## HOW TO USE ```python 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) ```