-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
81 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from dataclasses import dataclass | ||
from typing import Literal | ||
from cpo_config import CPOConfig | ||
|
||
|
||
@dataclass | ||
class CPOSimPOConfig(CPOConfig): | ||
""" | ||
基于CPOConfig,只需修改 | ||
""" | ||
loss_type: Literal["sigmoid", "hinge", "ipo", "simpo"] = "simpo" | ||
"""The type of loss to use.""" | ||
cpo_alpha: float = 0.5 | ||
"""combined use of CPO and SimPO, which enables more stable training and improved performance.A non-zero | ||
cpo_alpha""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from dataclasses import dataclass | ||
from typing import Literal | ||
from cpo_config import CPOConfig | ||
|
||
|
||
@dataclass | ||
class SimPOConfig(CPOConfig): | ||
""" | ||
基于CPOConfig,只需修改 | ||
""" | ||
loss_type: Literal["sigmoid", "hinge", "ipo", "simpo"] = "simpo" | ||
"""The type of loss to use.""" | ||
cpo_alpha: float = 0 | ||
"""A hyperparameter that controls the strength of the BC regularizer in CPO training.""" | ||
simpo_gamma: float = 0.5 | ||
"""A target reward margin for the SimPO loss, used only when the "simpo" option is enabled.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters