Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add max_length and max_prompt_length #367

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions orpo_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class ScriptArguments:
The name of the Casual LM model we wish to fine with DPO
"""
# Model arguments

max_length: Optional[int] = field(default=512,
metadata={"help": "Maximum total input sequence length after tokenization."})
max_prompt_length: Optional[int] = field(default=128, metadata={"help": "Maximum length of prompt sequences."})

model_type: str = field(
default=None,
metadata={"help": "Model type selected in the list: " + ", ".join(MODEL_CLASSES.keys())}
Expand Down Expand Up @@ -415,6 +420,8 @@ def main():
model.config.use_cache = True

training_args = ORPOConfig(
max_length=args.max_length,
max_prompt_length=args.max_prompt_length,
per_device_train_batch_size=args.per_device_train_batch_size,
per_device_eval_batch_size=args.per_device_eval_batch_size,
max_steps=args.max_steps,
Expand Down