Views
No views yet
transformers library:1import transformers
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4# Load Model and Tokenizer
5model_name = "PrompTartLAB/Llama3ko_8B_inst_PTT_enko"
6model = AutoModelForCausalLM.from_pretrained(
7 model_name,
8 torch_dtype="auto",
9 device_map="auto",
10)
11tokenizer = AutoTokenizer.from_pretrained(model_name)
12
13# Example sentence
14text = "The model was fine-tuned using knowledge distillation techniques. The training dataset was created using a collaborative multi-agent framework powered by large language models."
15prompt = f"Translate input sentence to Korean \n### Input: {text} \n### Translated:"
16
17# Tokenize and generate translation
18input_ids = tokenizer(prompt, return_tensors="pt").to(model.device)
19outputs = model.generate(**input_ids, max_new_tokens=1024)
20out_message = tokenizer.decode(outputs[0][len(input_ids["input_ids"][0]):], skip_special_tokens=True)
21
22# " 이 모델은 지식 증류 기법(knowledge distillation techniques)을 사용하여 미세 조정되었습니다. 훈련 데이터셋은 대형 언어 모델(large language models)로 구동되는 협력적 다중 에이전트 프레임워크(collaborative multi-agent framework)를 사용하여 생성되었습니다."
231@misc{myung2024efficienttechnicaltermtranslation,
2 title={Efficient Technical Term Translation: A Knowledge Distillation Approach for Parenthetical Terminology Translation},
3 author={Jiyoon Myung and Jihyeon Park and Jungki Son and Kyungro Lee and Joohyung Han},
4 year={2024},
5 eprint={2410.00683},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2410.00683},
9}