Expand description
Examples from Chapter 7
Modules§
- addons
- Auxiliary module for examples::ch07
Structs§
- EG01
- Example usage of
download_and_load_file
- EG02
- Example usage of
format_input
- EG03
- Example usage of
partition_data
- EG04
- Example usage of
<|endoftext|>
special token with tiktoken - EG05
- Example usage of
InstructionDataCollator.custom_collate_fn
- EG06
- An adapted example demonstrating effect of
ignore_index
incalc_loss_batch
- EG07
- Creating a
InstructionDataLoader
for each of the train, val and test data partitions - EG08
- Example usage of
download_and_load_gpt2
and sample instruction inference - EG09
- Example usage of
calc_loss_loader
to compute cross-entropy loss on train, val, test sets - EG10
- Example usage of
train_model_simple
andplot_losses
functions - EG11
- Example of extracting model-generated responses and comparing to correct ones
- EG12
- Example usage of
generate_test_set_responses
- EG13
- An example to check if
ollama
process is running - EG14
- Example usage of
query_model
- EG15
- Using Llama3.2 (via Ollama) as the LLM judge to evaluate model responses
- EG16
- Example usage of
generate_model_scores
- EG17
- [Bonus] Usage of
generate_chosen_and_rejected_response
to create preference example - EG18
- [BONUS] Example usage of
generate_preference_dataset
- EG19
- [BONUS] Example usage of
PreferenceDataCollator.custom_collate_fn
- EG20
- [BONUS] Creating a
PreferenceDataLoader
- EG21
- [BONUS] Example usage of
compute_dpo_loss_batch
- EG22
- [BONUS] Example usage of
compute_dpo_loss_loader
- EG23
- [BONUS] Example usage of
train_model_dpo_simple
andplot_losses
functions