Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ContextualAI/HALOs
/ types & classes
Types & classes
29 in github.com/ContextualAI/HALOs
⨍
Functions
162
◇
Types & classes
29
↓ 15 callers
Class
Dataset
A collection of Example instances, indexed by prompt.
train/data.py:108
↓ 2 callers
Class
StreamingJSONWriter
Writes JSON arrays to a file in a streaming fashion.
train/utils.py:48
↓ 1 callers
Class
Example
Class for an example in a preference or SFT dataset. If you want each prompt to be uniquely associated with an Example instance, save it in a dic
train/data.py:38
↓ 1 callers
Class
ReferenceModelWrapper
A wrapper around the reference model that precomputes the logprobs and saves them in a local dict, after which the reference model and accele
train/models.py:425
↓ 1 callers
Class
SFTDataLoader
Dataloader for supervised fine-tuning.
train/dataloader.py:276
↓ 1 callers
Class
ValueHead
r""" The ValueHead class implements a head for autoregressive that returns a scalar for each output token. The weights of the value head need
train/models.py:201
Class
AutoModelForBradleyTerry
A wrapper around AutoModelForSequenceClassification that ensures binary classification.
train/models.py:553
Class
AutoModelForCausalLMWithValueHead
r""" An autoregressive model with a value head in addition to the language model head. Class attributes: - **transformers_parent_clas
train/models.py:239
Class
BasicTrainer
train/trainers.py:59
Class
BradleyTerryTrainer
train/trainers.py:1541
Class
CDPOTrainer
train/trainers.py:767
Class
ConditionalSFTDataLoader
Dataloader for token-conditioned SFT, in the style of Korbak et al.'s (2023) "Pretraining Models with Human Feedback." For training, eac
train/dataloader.py:345
Class
DPOTrainer
train/trainers.py:746
Class
DataLoader
The base data loader class, similar to the one from the DPO repo. Subclass this and overwrite the __iter__ method as needed, since the batch
train/dataloader.py:31
Class
GRPOTrainer
train/trainers.py:1009
Class
GroupUnpairedPreferenceDataLoader
A variant of UnpairedPreferenceDataLoader that groups examples with the same prompt in the same batch (but distributed across different proce
train/dataloader.py:590
Class
HalfPrefDataLoader
Dataloader for training on only one output per input. This throws out at least half the data (more than half if there are multiple pairs per
train/dataloader.py:659
Class
IPOTrainer
train/trainers.py:790
Class
KTOTrainer
train/trainers.py:851
Class
PPOTrainer
train/trainers.py:1106
Class
PairedPreferenceDataLoader
Dataloader for losses that do require pairwise preferences (e.g., DPO).
train/dataloader.py:691
Class
PairedPreferenceTrainer
train/trainers.py:654
Class
PreTrainedModelWrapper
r""" A wrapper class around a (`transformers.PreTrainedModel`) to be compatible with the (`~transformers.PreTrained`) class in order to keep s
train/models.py:25
Class
SFTTrainer
train/trainers.py:552
Class
SLiCTrainer
train/trainers.py:824
Class
ScoreDataLoader
train/dataloader.py:633
Class
SimPOTrainer
train/trainers.py:808
Class
UnpairedPreferenceDataLoader
Dataloader for losses that do not require pairwise preferences (e.g., KTO). This assumes that if an example has no pairs, then it is natural
train/dataloader.py:451
Class
UnpairedPreferenceTrainer
train/trainers.py:584