Downloads · 30 days
24
12% of all-time downloads
werty1248/EXAONE-3.5-7.8B-SFT-Translation-Style-Tag-DPO
EXAONE-3.5-7.8B-SFT-Translation-Style-Tag-DPO is a text generation model from werty1248. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
24
12% of all-time downloads
All-time downloads
207
Public
Parameters
7.8B
15.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors15.6 GB · 100%
From the Hugging Face model README
다음 텍스트를 한국어로 번역해 주세요.
번역 스타일: 일반 대중, 반말, 노래 가사, 부드러움, ~하네
단어장: {'the director':'대창섭', 'back to normal':'정상화'}
The director finally gets Maple back to normal.
# 출력
대창섭은 마침내 메이플을 정상화시킨다네.'
스타일은 전달 대상, 존댓말/반말 여부, 문체, 어미 등을 설정할 수 있습니다.
단어장의 경우, dictionary 형태로 제공되어야 하며, 입력된 단어장을 과잉 반영하는 경향이 있으므로 신중하게 사용해야 합니다.
순수 번역 성능 자체는 예상보다 낮은 편입니다.
base_model: beomi/EXAONE-3.5-7.8B-Instruct-Llamafied
model_type: AutoModelForCausalLM
tokenizer_config: beomi/EXAONE-3.5-7.8B-Instruct-Llamafied
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: false
strict: false
datasets:
- path: werty1248/KoEn-Parallel-Full-Conv
field_messages: conversations
train_on_eos: turn
type: chat_template
chat_template: tokenizer_default
dataset_prepared_path: ./data_preparation
output_dir: /workspace/data
hf_use_auth_token: true
sequence_len: 8192
sample_packing: true
pad_to_sequence_len: true
adapter: lora
lora_r: 32
lora_alpha: 16
lora_dropout: 0.1
lora_target_modules:
lora_target_linear: true
lora_fan_in_fan_out:
peft_use_rslora: true
plugins:
- axolotl.integrations.liger.LigerPlugin
liger_rope: true
liger_rms_norm: true
liger_layer_norm: true
liger_glu_activation: true
liger_fused_linear_cross_entropy: true
wandb_project:
#wandb_entity:
#wandb_watch:
wandb_name:
#wandb_log_model:
gradient_accumulation_steps: 2
micro_batch_size: 1
num_epochs: 1
optimizer: paged_ademamix_32bit
lr_scheduler: cosine
learning_rate: 0.000005
weight_decay: 0.1
train_on_inputs: false
group_by_length: false
bf16: auto
fp16:
tf32: false
gradient_checkpointing: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
warmup_steps: 100
evals_per_epoch: 1
eval_table_size:
deepspeed: ./deepspeed_configs/zero3_bf16.json
</details>
※ 이대로 실행하면 에러가 발생합니다. Axolotl의 ORPO쪽 데이터 로딩 & chat_template 코드를 수정해서 사용했습니다.
base_model: werty1248/EXAONE-3.5-7.8B-SFT-Translation-Style-Tag
model_type: AutoModelForCausalLM
tokenizer_config: werty1248/EXAONE-3.5-7.8B-SFT-Translation-Style-Tag
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: false
strict: false
rl: orpo
datasets:
- path: werty1248/Open-KoEn-Parallel-Style-Glossary-DPO
name: wo_system
type: chat_template.default
field_messages: messages
field_chosen: chosen
field_rejected: rejected
message_field_role: role
message_field_content: content
dataset_prepared_path: ./data_preparation
output_dir: /workspace/data
hf_use_auth_token: true
sequence_len: 8192
sample_packing: false
pad_to_sequence_len: true
adapter: lora
lora_r: 8
lora_alpha: 16
lora_dropout: 0.1
lora_target_modules:
lora_target_linear: true
lora_fan_in_fan_out:
peft_use_rslora: true
plugins:
- axolotl.integrations.liger.LigerPlugin
liger_rope: true
liger_rms_norm: true
liger_layer_norm: true
liger_glu_activation: true
liger_fused_linear_cross_entropy: true
wandb_project:
#wandb_entity:
#wandb_watch:
wandb_name:
#wandb_log_model:
gradient_accumulation_steps: 16
micro_batch_size: 1
num_epochs: 1
optimizer: adamw_torch
lr_scheduler: cosine
learning_rate: 0.000005
train_on_inputs: false
group_by_length: false
bf16: auto
gradient_checkpointing: true
flash_attention: true
saves_per_epoch: 1
logging_steps: 1
warmup_steps: 20
#deepspeed: ./deepspeed_configs/zero3_bf16.json
</details>
!pip install vllm
from vllm import LLM, SamplingParams
name = "werty1248/EXAONE-3.5-7.8B-SFT-Translation-Style-Tag-DPO"
llm = LLM(model=name, max_model_len=2048)
sampling_params = SamplingParams(temperature=0, max_tokens=512, stop=['[|assistant|]',]) # 템플릿 문제
normal_request = """다음 텍스트를 한국어로 번역해 주세요.
The director finally gets Maple back to normal."""
style_request = """다음 텍스트를 한국어로 번역해 주세요.
번역 스타일: 일반 대중, 반말, 노래 가사, 부드러움, ~하네
The director finally gets Maple back to normal."""
glossary_request = """다음 텍스트를 한국어로 번역해 주세요.
단어장: {'the director':'대창섭', 'back to normal':'정상화'}
The director finally gets Maple back to normal."""
style_glossary_request = """다음 텍스트를 한국어로 번역해 주세요.
번역 스타일: 일반 대중, 반말, 노래 가사, 부드러움, ~하네
단어장: {'the director':'대창섭', 'back to normal':'정상화'}
The director finally gets Maple back to normal."""
input_list = [[{"role":"user","content":normal_request}],
[{"role":"user","content":style_request}],
[{"role":"user","content":glossary_request}],
[{"role":"user","content":style_glossary_request}]]
outputs = llm.chat(input_list, sampling_params)
pred_list = [x.outputs[0].text for x in outputs]
print("영어: The director finally gets Maple back to normal.\n")
print("\n".join(pred_list))
영어: The director finally gets Maple back to normal.
감독은 마침내 메이플을 정상으로 돌려놓는다. # normal_request
감독은 마침내 메이플을 정상으로 돌려놓네. # style_request
대창섭은 마침내 메이플을 정상화시킵니다.' # glossary_request
대창섭은 마침내 메이플을 정상화시킨다네.' # style_glossary_request