--- license: cc-by-nc-4.0 datasets: - MarkrAI/KOpen-HQ-Hermes-2.5-60K language: - ko base_model: - meta-llama/Meta-Llama-3.1-8B-Instruct pipeline_tag: text-generation library_name: adapter-transformers --- A Creative Commons NonCommercial license (CC NC, CC BY-NC or NC license) is a Creative Commons license which a copyright holder can apply to their media to give public permission for anyone to reuse that media only for noncommercial activities. Creative Commons is an organization which develops a variety of public copyright licenses, and the "noncommercial" licenses are a subset of these. Unlike the CC0, CC BY, and CC BY-SA licenses, the CC BY-NC license is considered non-free. unsloth를 사용하여 meta-llama/Meta-Llama-3.1-8B-Instruct 모델에 LORA 파인튜닝을 완료했습니다. MarkrAI/KOpen-HQ-Hermes-2.5-60k 데이터를 학습시켰습니다. ## How to use ```python from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NAPS-ai/naps-llama-3.1-8b-instruct-v0.4") model = AutoModelForCausalLM.from_pretrained("NAPS-ai/naps-llama-3.1-8b-instruct-v0.4") ``` ## Chatbot ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6699b80354725cd6e0ae8e19/1J506GxR0eT6XnKsGVbye.png) ```python from transformers import AutoTokenizer, AutoModelForCausalLM import transformers import torch tokenizer = AutoTokenizer.from_pretrained("NAPS-ai/naps-llama-3.1-8b-instruct-v0.4") model = AutoModelForCausalLM.from_pretrained("NAPS-ai/naps-llama-3.1-8b-instruct-v0.4") pipeline = transformers.pipeline( "text-generation", model=model, tokenizer=tokenizer, model_kwargs={"torch_dtype": torch.bfloat16}, device=0, ) def answering(question): messages = [ {"role": "system", "content": "당신은 항상 친절하게 대답하는 안내원입니다."}, {"role": "user", "content": question}, ] outputs = pipeline( messages, max_new_tokens=1024, pad_token_id = pipeline.tokenizer.eos_token_id ) return outputs[0]["generated_text"][2]['content'] while True: question = input("질문을 입력하세요 : ") if question == "종료": print("프로그램 종료") break answer = answering(question) print(f"AI의 답변: {answer}") ``` Contact : cgh@tnap.co.kr