Skip to content

Commit

Permalink
【开源之夏】add dpo trainer and support dpo training for mindnlp (#1701)
Browse files Browse the repository at this point in the history
  • Loading branch information
Trace2333 authored Oct 31, 2024
1 parent 47f2de8 commit d250d79
Show file tree
Hide file tree
Showing 14 changed files with 6,322 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mindnlp/trl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@
# limitations under the License.
# ============================================================================
"""MindNLP Transformer Reinforcement Learning."""

from .trainer import (
DPOTrainer,
DPOConfig,
FDivergenceType,
_build_tokenized_answer,
_truncate_tokens
)
Empty file added mindnlp/trl/import_utils.py
Empty file.
5 changes: 5 additions & 0 deletions mindnlp/trl/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""trl model __init__"""
from .modeling_base import (
PreTrainedModelWrapper,
create_reference_model
)
639 changes: 639 additions & 0 deletions mindnlp/trl/models/modeling_base.py

Large diffs are not rendered by default.

Loading

0 comments on commit d250d79

Please sign in to comment.