MCPcopy Create free account

hub / github.com/ContextualAI/HALOs / functions

Functions162 in github.com/ContextualAI/HALOs

Method__iter__
(self)
train/dataloader.py:288
Method__iter__
(self)
train/dataloader.py:382
Method__iter__
(self)
train/dataloader.py:519
Method__iter__
(self)
train/dataloader.py:712
Method__iter__
(self)
train/data.py:128
Method__len__
(self)
train/data.py:125
Method__setattr__
Set prompt ID automatically.
train/data.py:52
Method__setitem__
(self, key, value)
train/data.py:116
Methodclean
(text: str)
train/data.py:95
Functionclip_by_value
Tensor extenstion to torch.clamp https://github.com/pytorch/pytorch/issues/2793#issuecomment-428784713
train/utils.py:131
Functiondelete_dict
Delete all items inside the dict.
train/utils.py:200
Functiondisable_dropout
Disable dropout in a model.
train/utils.py:193
Methodforward
(self, hidden_states)
train/models.py:231
Methodforward
r""" Applies a forward pass to the wrapped model and returns the logits of the value head. Args: input_ids (`torch.LongTe
train/models.py:317
Methodfrom_pretrained
(cls, load_from, *args, **kwargs)
train/models.py:414
Methodfrom_pretrained
Overrides from_pretrained to ensure num_labels=2. Args: pretrained_model_name_or_path: Either: -
train/models.py:557
Functionget_alpacaeval
Load the AlpacaEval dataset (for evaluation only) and convert it into a Dataset. Args: - split: must be 'test'; otherwise error will
train/data.py:132
Methodget_batch_metrics
Compute the loss and other metrics for the given batch of inputs. Args: batch: dictionary of inputs for the batch (should
train/trainers.py:555
Methodget_batch_metrics
Compute the loss and other metrics for the given batch of inputs.
train/trainers.py:615
Methodget_batch_metrics
Compute the loss and other metrics for the given batch of inputs.
train/trainers.py:713
Methodget_batch_metrics
Compute the loss and other metrics for the given batch of inputs.
train/trainers.py:962
Methodget_batch_metrics
Compute the loss and other metrics for the given batch of inputs.
train/trainers.py:1060
Methodget_batch_metrics
Compute metrics for a batch of examples. Args: batch: The input batch mode: Either 'train' or 'eval'
train/trainers.py:1605
Functionget_feedback
Load feedback data created by label.py and convert it into a Dataset. Supports both binary and pairwise feedback formats. Args:
train/data.py:191
Methodget_flat_data
(self, prompts)
train/dataloader.py:280
Methodget_flat_data
Return a flat list of examples given a list of prompts that index self.full_data. Prepend the examples with the appropriate control t
train/dataloader.py:363
Methodget_flat_data
Return a flat list of examples given a list of prompts that index self.full_data.
train/dataloader.py:468
Methodget_flat_data
Return a flat list of examples given a list of prompts that index self.full_data. Assumes that there are a list of scores.
train/dataloader.py:634
Methodget_flat_data
Return a flat list of examples given a list of prompts that index self.full_data. Only use one preference pair per input.
train/dataloader.py:665
Methodget_flat_data
Return a flat list of examples given a list of prompts.
train/dataloader.py:695
Functionget_hh_harmless
(split: str)
train/data.py:396
Functionget_hh_helpful
(split: str)
train/data.py:392
Methodget_num_training_steps
Get the number of training steps.
train/dataloader.py:337
Methodget_num_training_steps
(self)
train/dataloader.py:437
Methodget_num_training_steps
(self)
train/dataloader.py:576
Methodget_num_training_steps
(self)
train/dataloader.py:751
Functionget_oasst
Load the Open Assistant dataset from Huggingface and convert it into to a Dataset. For this dataset, the SFT text is the preferred response.
train/data.py:400
Methodget_process_data
Return the subset of data to be processed in the current process. Examples sharing the same prompt ID will appear consecutively, in
train/dataloader.py:597
Methodget_reward_scores
Get reward scores from reward model. Args: batch: Dictionary containing batch data Returns:
train/trainers.py:224
Functionget_s1k_11
Load the Ultrafeedback (binarized) dataset from Huggingface and convert it into to a Dataset. For this dataset, the SFT text is the preferred
train/data.py:592
Functionget_safe_rlhf
Load the PKU-Alignment PKU-SafeRLHF dataset from Huggingface and convert it into to a Dataset. For this dataset, the SFT text is the preferre
train/data.py:627
Functionget_sampled_data
Load samples generated by train.sample and convert it into a Dataset.
train/data.py:165
Functionget_shp
Load the Stanford Human Preferences dataset from Huggingface and convert it into to a Dataset. We filter preference pairs to only keep pairs
train/data.py:287
Functionget_ultrabin
Load the Ultrafeedback (binarized) dataset from Huggingface and convert it into to a Dataset. For this dataset, the SFT text is the preferred
train/data.py:464
Functionget_ultrachat
(split: str)
train/data.py:573
Functionget_ultrafeedback_armorm
(split: str)
train/data.py:513
Functionget_ultrafeedback_armorm_gemma
(split: str)
train/data.py:543
Functionget_wildbench
Load the AllenAI WildBench dataset from Huggingface and convert it into to a Dataset. For this dataset, the SFT text is the preferred respons
train/data.py:666
Methodloss
Args: batch: batch of data, mapping keys to Tensors policy_chosen_logps: Log probabilities of the policy model for th
train/trainers.py:190
Methodloss
Compute the CDPO loss for a batch of policy and reference model token-level log probabilities.
train/trainers.py:768
Methodloss
Compute the IPO loss for a batch of policy and reference model token-level log probabilities.
train/trainers.py:791
Methodloss
Compute the SimPO loss for a batch of policy and reference model token-level log probabilities.
train/trainers.py:809
Methodloss
Compute the SLIC loss as defined by Zhao et al. in https://arxiv.org/pdf/2305.10425.pdf Calibration loss defined as: L(x, y) := m
train/trainers.py:827
Methodpost_init
r""" We add the state dictionary of the value head to the state dictionary of the wrapped model by prepending the key with `v_head.`.
train/models.py:391
Methodprepare_accelerator
Prepare the Accelerator.
train/trainers.py:1110
Functionprint_gpu_memory
Print the amount of GPU memory currently allocated for each GPU.
train/utils.py:213
Methodpush_to_hub
(self, *args, **kwargs)
train/models.py:387
Methodsave_pretrained
Save a model and its configuration file to a directory. Ensures the config maintains num_labels=2 and padding token configuration whe
train/models.py:593
Methodstate_dict
r""" Returns the state dictionary of the model. We add the state dictionary of the value head to the state dictionary of the wrapped m
train/models.py:375
Methodtrain
Begin either SFT or HALO training, with periodic evaluation. This is subclassed when implementing PPO.
train/trainers.py:312
Methodupdate_batch
Args: batch: the original offline batch completions: the online generations from the updated reference model (after s
train/trainers.py:513
Methodweights_init
(m)
train/models.py:310
← previous101–162 of 162, ranked by callers