kwoncho/Llama-3.2-3B-KO-EN-Translation
Model Card for Model ID
한국어/영어 번역용으로 훈련한 모형입니다. llama3.2의 경우 한국어-영어 번역에 오류가 잦아 별도로 훈련시켰습니다. 성능향상을 위해 추가훈련을 진행했습니다.
아래 사항에 주의해 주세요:
- 이 모델은 문장단위 번역으로 훈련시켰습니다. 따라서 긴 텍스트의 경우 번역에 오류가 있을 수 있습니다. 또한 인풋 텍스트에 줄바꿈이 있을 경우 결과물을 추출하는데 복잡해질 수 있습니다.
- 이 모델의 주 용도는 금융/경영 관련으로 상정하고 훈련했습니다.
- 총 47만여개의 금융 관련 문장 페어를 사용하여 훈련하였습니다. 추가로 약 50여만개의 일반 문장을 사용하였습니다.
- 이하 모델카드는 시간이 나는대로 추가하겠습니다.
- 주의할 몇몇 점
- 숫자 등을 마음대로 생성하는 경우가 있어, "퍼센트, 금액, 숫자는 본문의 숫자를 그대로 사용하세요."" 등의 프롬프트를 추가하는 등을 고려해 주시기 바랍니다.
- 영한 번역은 성능이 상당히 부족합니다.
- 사용에 있어, 아래 코드를 참고해주세요:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_path = "kwoncho/Llama-3.2-3B-KO-EN-Translation"
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.bfloat16,
device_map="cuda:0",
)
tokenizer = AutoTokenizer.from_pretrained(model_path)- 한국어 -> 영어의 경우
test_input = "삼성생명이 프랑스의 인프라 투자 전문 운용사의 2대 주주로 올랐다."
prompt = f"""
### Instruction:
주어진 텍스트를 영어로 번역하세요.
### Input:
{test_input}
### Output:
"""- 영어 -> 한국어의 경우
test_input = """Retailers were “incentivising via discounts and different forms of promotions” for those at the lower end of the income spectrum while also “trying to grab higher-income individuals to make purchases during this wider window”, he said."""
prompt = f"""
### Instruction:
주어진 텍스트를 한국어로 번역하세요.
### Input:
{test_input}
### Output:
"""input_ids = tokenizer.encode(prompt, return_tensors="pt").to(model.device)
output = model.generate(
input_ids,
max_new_tokens=200,
temperature=0.1,
top_p=1,
repetition_penalty=1.3,
do_sample=True,
eos_token_id=tokenizer.eos_token_id
)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
outputs = generated_text.split("Output:")[1].strip().split('\n')[0].strip()
print(outputs) ### 한영 번역의 경우
"Samsung Life Insurance has become the second-largest shareholder of a French infrastructure investment management company."
print(outputs) ### 영한 번역의 경우
"그는 "소매상들은 소득 하위층을 대상으로 할부, 할인 등 다양한 형태의 인센티브를 제공하면서도 상위 계층의 고객들을 끌어모으려 하고 있다"고 말했다."Model Details
Model Description
<!-- Provide a longer summary of what this model is. -->
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
- Developed by: Hyunkwon Cho (Kwon Cho)
- Funded by [optional]: [More Information Needed]
- Shared by [optional]: [More Information Needed]
- Model type: [More Information Needed]
- Language(s) (NLP): [More Information Needed]
- License: [More Information Needed]
- Finetuned from model [optional]: [More Information Needed]
Model Sources [optional]
<!-- Provide the basic links for the model. -->
- Repository: [More Information Needed]
- Paper [optional]: [More Information Needed]
- Demo [optional]: [More Information Needed]
Uses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
Direct Use
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
[More Information Needed]
Downstream Use [optional]
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
[More Information Needed]
Out-of-Scope Use
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
[More Information Needed]
Bias, Risks, and Limitations
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
[More Information Needed]
Recommendations
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
Use the code below to get started with the model.
[More Information Needed]
Training Details
Training Data
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
[More Information Needed]
Training Procedure
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
Preprocessing [optional]
[More Information Needed]
Training Hyperparameters
- Training regime: [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
Speeds, Sizes, Times [optional]
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
[More Information Needed]
Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
Testing Data, Factors & Metrics
Testing Data
<!-- This should link to a Dataset Card if possible. -->
[More Information Needed]
Factors
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
[More Information Needed]
Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
[More Information Needed]
Results
[More Information Needed]
Summary
Model Examination [optional]
<!-- Relevant interpretability work for the model goes here -->
[More Information Needed]
Environmental Impact
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: [More Information Needed]
- Hours used: [More Information Needed]
- Cloud Provider: [More Information Needed]
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed]
Technical Specifications [optional]
Model Architecture and Objective
[More Information Needed]
Compute Infrastructure
[More Information Needed]
Hardware
[More Information Needed]
Software
[More Information Needed]
Citation [optional]
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
[More Information Needed]
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
[More Information Needed]
Model Card Contact
[More Information Needed]
