mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
committed by
GitHub
parent
7757c3d308
commit
c21bfe4a23
@@ -55,7 +55,7 @@ You can use the following code to reproduce the experiments:
|
||||
- Row 16: `python additional_experiments.py --trainable_token_pos "flexible"`
|
||||
- Row 17: `python additional_experiments.py --disable_causal_mask`
|
||||
- Row 18: `python additional_experiments.py --ignore_index 50256`
|
||||
- Row 19: `python additional_experiments.py --average embeddings`
|
||||
- Row 19: `python additional_experiments.py --average_embeddings`
|
||||
|
||||
I've kept the LLM and dataset small on purpose, so you can run the training on a regular laptop like a MacBook Air M3 in about 15 minutes (for the default setting) in case you don't have access to a GPU.
|
||||
|
||||
|
||||
@@ -21,6 +21,14 @@ from gpt_download import download_and_load_gpt2
|
||||
from previous_chapters import GPTModel, load_weights_into_gpt
|
||||
|
||||
|
||||
# If the `previous_chapters.py` file is not available locally,
|
||||
# you can import it from the `llms-from-scratch` PyPI package.
|
||||
# For details, see: https://github.com/rasbt/LLMs-from-scratch/tree/main/pkg
|
||||
# E.g.,
|
||||
# from llms_from_scratch.ch04 import GPTModel
|
||||
# from llms_from_scratch.ch05 import download_and_load_gpt2, load_weights_into_gpt
|
||||
|
||||
|
||||
class LoRALayer(torch.nn.Module):
|
||||
def __init__(self, in_dim, out_dim, rank, alpha):
|
||||
super().__init__()
|
||||
|
||||
Reference in New Issue
Block a user