├── .github ├── ISSUE_TEMPLATE │ ├── ask-a-question.md │ └── bug-report.yaml └── workflows │ ├── basic-tests-linux.yml │ ├── basic-tests-macos.yml │ ├── basic-tests-old-pytorch.yml │ ├── basic-tests-windows.yml │ ├── check-links.yml │ ├── check-spelling-errors.yml │ └── pep8-linter.yml ├── .gitignore ├── CITATION.cff ├── LICENSE.txt ├── README.md ├── appendix-A ├── 01_main-chapter-code │ ├── DDP-script.py │ ├── code-part1.ipynb │ ├── code-part2.ipynb │ └── exercise-solutions.ipynb └── 02_setup-recommendations │ └── README.md ├── appendix-D ├── 01_main-chapter-code │ ├── appendix-D.ipynb │ ├── previous_chapters.py │ └── the-verdict.txt └── README.md ├── appendix-E ├── 01_main-chapter-code │ ├── appendix-E.ipynb │ ├── gpt_download.py │ └── previous_chapters.py └── README.md ├── ch01 └── README.md ├── ch02 ├── 01_main-chapter-code │ ├── README.md │ ├── ch02.ipynb │ ├── dataloader.ipynb │ ├── exercise-solutions.ipynb │ └── the-verdict.txt ├── 02_bonus_bytepair-encoder │ ├── README.md │ ├── bpe_openai_gpt2.py │ ├── compare-bpe-tiktoken.ipynb │ ├── gpt2_model │ │ ├── encoder.json │ │ └── vocab.bpe │ └── requirements-extra.txt ├── 03_bonus_embedding-vs-matmul │ ├── README.md │ └── embeddings-and-linear-layers.ipynb ├── 04_bonus_dataloader-intuition │ ├── README.md │ └── dataloader-intuition.ipynb └── README.md ├── ch03 ├── 01_main-chapter-code │ ├── README.md │ ├── ch03.ipynb │ ├── exercise-solutions.ipynb │ ├── multihead-attention.ipynb │ └── small-text-sample.txt ├── 02_bonus_efficient-multihead-attention │ ├── README.md │ └── mha-implementations.ipynb ├── 03_understanding-buffers │ ├── README.md │ └── understanding-buffers.ipynb └── README.md ├── ch04 ├── 01_main-chapter-code │ ├── README.md │ ├── ch04.ipynb │ ├── exercise-solutions.ipynb │ ├── gpt.py │ ├── previous_chapters.py │ └── tests.py ├── 02_performance-analysis │ ├── README.md │ ├── flops-analysis.ipynb │ ├── previous_chapters.py │ └── requirements-extra.txt └── README.md ├── ch05 ├── 01_main-chapter-code │ ├── README.md │ ├── ch05.ipynb │ ├── exercise-solutions.ipynb │ ├── gpt_download.py │ ├── gpt_generate.py │ ├── gpt_train.py │ ├── previous_chapters.py │ └── tests.py ├── 02_alternative_weight_loading │ ├── README.md │ ├── previous_chapters.py │ └── weight-loading-hf-transformers.ipynb ├── 03_bonus_pretraining_on_gutenberg │ ├── README.md │ ├── prepare_dataset.py │ ├── pretraining_simple.py │ ├── previous_chapters.py │ └── tests.py ├── 04_learning_rate_schedulers │ └── README.md ├── 05_bonus_hparam_tuning │ ├── README.md │ ├── hparam_search.py │ ├── previous_chapters.py │ └── the-verdict.txt ├── 06_user_interface │ ├── README.md │ ├── app_orig.py │ ├── app_own.py │ ├── previous_chapters.py │ └── requirements-extra.txt ├── 07_gpt_to_llama │ ├── README.md │ ├── config.json │ ├── converting-gpt-to-llama2.ipynb │ ├── converting-llama2-to-llama3.ipynb │ ├── previous_chapters.py │ ├── requirements-extra.txt │ ├── standalone-llama32.ipynb │ └── tests │ │ ├── test-requirements-extra.txt │ │ └── tests.py ├── 08_memory_efficient_weight_loading │ ├── README.md │ ├── memory-efficient-state-dict.ipynb │ └── previous_chapters.py └── README.md ├── ch06 ├── 01_main-chapter-code │ ├── README.md │ ├── ch06.ipynb │ ├── exercise-solutions.ipynb │ ├── gpt_class_finetune.py │ ├── gpt_download.py │ ├── load-finetuned-model.ipynb │ ├── previous_chapters.py │ └── tests.py ├── 02_bonus_additional-experiments │ ├── README.md │ ├── additional_experiments.py │ ├── gpt_download.py │ └── previous_chapters.py ├── 03_bonus_imdb-classification │ ├── README.md │ ├── download_prepare_dataset.py │ ├── gpt_download.py │ ├── previous_chapters.py │ ├── requirements-extra.txt │ ├── sklearn-baseline.ipynb │ ├── train_bert_hf.py │ ├── train_bert_hf_spam.py │ ├── train_gpt.py │ └── train_sklearn_logreg.py ├── 04_user_interface │ ├── README.md │ ├── app.py │ ├── previous_chapters.py │ └── requirements-extra.txt └── README.md ├── ch07 ├── 01_main-chapter-code │ ├── README.md │ ├── ch07.ipynb │ ├── exercise-solutions.ipynb │ ├── exercise_experiments.py │ ├── gpt_download.py │ ├── gpt_instruction_finetuning.py │ ├── instruction-data-with-response.json │ ├── instruction-data.json │ ├── load-finetuned-model.ipynb │ ├── ollama_evaluate.py │ ├── previous_chapters.py │ └── tests.py ├── 02_dataset-utilities │ ├── README.md │ ├── config.json │ ├── create-passive-voice-entries.ipynb │ ├── find-near-duplicates.py │ ├── instruction-examples-modified.json │ ├── instruction-examples.json │ └── requirements-extra.txt ├── 03_model-evaluation │ ├── README.md │ ├── config.json │ ├── eval-example-data.json │ ├── llm-instruction-eval-ollama.ipynb │ ├── llm-instruction-eval-openai.ipynb │ ├── requirements-extra.txt │ └── scores │ │ ├── correlation-analysis.ipynb │ │ ├── gpt4-model-1-response.json │ │ ├── gpt4-model-2-response.json │ │ ├── llama3-8b-model-1-response.json │ │ └── llama3-8b-model-2-response.json ├── 04_preference-tuning-with-dpo │ ├── README.md │ ├── create-preference-data-ollama.ipynb │ ├── dpo-from-scratch.ipynb │ ├── instruction-data-with-preference.json │ └── previous_chapters.py ├── 05_dataset-generation │ ├── README.md │ ├── config.json │ ├── instruction-data-llama3-7b.json │ ├── llama3-ollama.ipynb │ ├── reflection-gpt4.ipynb │ └── requirements-extra.txt ├── 06_user_interface │ ├── README.md │ ├── app.py │ ├── previous_chapters.py │ └── requirements-extra.txt └── README.md ├── requirements.txt ├── setup ├── .vscode │ └── extensions.json ├── 01_optional-python-setup-preferences │ └── README.md ├── 02_installing-python-libraries │ ├── README.md │ ├── python_environment_check.ipynb │ ├── python_environment_check.py │ └── tests.py ├── 03_optional-docker-environment │ ├── .devcontainer │ │ ├── Dockerfile │ │ ├── README.md │ │ └── devcontainer.json │ └── README.md └── README.md └── the-verdict.txt /.github/ISSUE_TEMPLATE/ask-a-question.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/ISSUE_TEMPLATE/ask-a-question.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/ISSUE_TEMPLATE/bug-report.yaml -------------------------------------------------------------------------------- /.github/workflows/basic-tests-linux.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/workflows/basic-tests-linux.yml -------------------------------------------------------------------------------- /.github/workflows/basic-tests-macos.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/workflows/basic-tests-macos.yml -------------------------------------------------------------------------------- /.github/workflows/basic-tests-old-pytorch.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/workflows/basic-tests-old-pytorch.yml -------------------------------------------------------------------------------- /.github/workflows/basic-tests-windows.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/workflows/basic-tests-windows.yml -------------------------------------------------------------------------------- /.github/workflows/check-links.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/workflows/check-links.yml -------------------------------------------------------------------------------- /.github/workflows/check-spelling-errors.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/workflows/check-spelling-errors.yml -------------------------------------------------------------------------------- /.github/workflows/pep8-linter.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.github/workflows/pep8-linter.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/.gitignore -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/CITATION.cff -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/LICENSE.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/README.md -------------------------------------------------------------------------------- /appendix-A/01_main-chapter-code/DDP-script.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-A/01_main-chapter-code/DDP-script.py -------------------------------------------------------------------------------- /appendix-A/01_main-chapter-code/code-part1.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-A/01_main-chapter-code/code-part1.ipynb -------------------------------------------------------------------------------- /appendix-A/01_main-chapter-code/code-part2.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-A/01_main-chapter-code/code-part2.ipynb -------------------------------------------------------------------------------- /appendix-A/01_main-chapter-code/exercise-solutions.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-A/01_main-chapter-code/exercise-solutions.ipynb -------------------------------------------------------------------------------- /appendix-A/02_setup-recommendations/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-A/02_setup-recommendations/README.md -------------------------------------------------------------------------------- /appendix-D/01_main-chapter-code/appendix-D.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-D/01_main-chapter-code/appendix-D.ipynb -------------------------------------------------------------------------------- /appendix-D/01_main-chapter-code/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-D/01_main-chapter-code/previous_chapters.py -------------------------------------------------------------------------------- /appendix-D/01_main-chapter-code/the-verdict.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-D/01_main-chapter-code/the-verdict.txt -------------------------------------------------------------------------------- /appendix-D/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-D/README.md -------------------------------------------------------------------------------- /appendix-E/01_main-chapter-code/appendix-E.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-E/01_main-chapter-code/appendix-E.ipynb -------------------------------------------------------------------------------- /appendix-E/01_main-chapter-code/gpt_download.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-E/01_main-chapter-code/gpt_download.py -------------------------------------------------------------------------------- /appendix-E/01_main-chapter-code/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-E/01_main-chapter-code/previous_chapters.py -------------------------------------------------------------------------------- /appendix-E/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/appendix-E/README.md -------------------------------------------------------------------------------- /ch01/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch01/README.md -------------------------------------------------------------------------------- /ch02/01_main-chapter-code/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/01_main-chapter-code/README.md -------------------------------------------------------------------------------- /ch02/01_main-chapter-code/ch02.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/01_main-chapter-code/ch02.ipynb -------------------------------------------------------------------------------- /ch02/01_main-chapter-code/dataloader.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/01_main-chapter-code/dataloader.ipynb -------------------------------------------------------------------------------- /ch02/01_main-chapter-code/exercise-solutions.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/01_main-chapter-code/exercise-solutions.ipynb -------------------------------------------------------------------------------- /ch02/01_main-chapter-code/the-verdict.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/01_main-chapter-code/the-verdict.txt -------------------------------------------------------------------------------- /ch02/02_bonus_bytepair-encoder/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/02_bonus_bytepair-encoder/README.md -------------------------------------------------------------------------------- /ch02/02_bonus_bytepair-encoder/bpe_openai_gpt2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/02_bonus_bytepair-encoder/bpe_openai_gpt2.py -------------------------------------------------------------------------------- /ch02/02_bonus_bytepair-encoder/compare-bpe-tiktoken.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/02_bonus_bytepair-encoder/compare-bpe-tiktoken.ipynb -------------------------------------------------------------------------------- /ch02/02_bonus_bytepair-encoder/gpt2_model/encoder.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/02_bonus_bytepair-encoder/gpt2_model/encoder.json -------------------------------------------------------------------------------- /ch02/02_bonus_bytepair-encoder/gpt2_model/vocab.bpe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/02_bonus_bytepair-encoder/gpt2_model/vocab.bpe -------------------------------------------------------------------------------- /ch02/02_bonus_bytepair-encoder/requirements-extra.txt: -------------------------------------------------------------------------------- 1 | requests 2 | tqdm 3 | transformers>=4.33.2 4 | -------------------------------------------------------------------------------- /ch02/03_bonus_embedding-vs-matmul/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/03_bonus_embedding-vs-matmul/README.md -------------------------------------------------------------------------------- /ch02/03_bonus_embedding-vs-matmul/embeddings-and-linear-layers.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/03_bonus_embedding-vs-matmul/embeddings-and-linear-layers.ipynb -------------------------------------------------------------------------------- /ch02/04_bonus_dataloader-intuition/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/04_bonus_dataloader-intuition/README.md -------------------------------------------------------------------------------- /ch02/04_bonus_dataloader-intuition/dataloader-intuition.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/04_bonus_dataloader-intuition/dataloader-intuition.ipynb -------------------------------------------------------------------------------- /ch02/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch02/README.md -------------------------------------------------------------------------------- /ch03/01_main-chapter-code/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/01_main-chapter-code/README.md -------------------------------------------------------------------------------- /ch03/01_main-chapter-code/ch03.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/01_main-chapter-code/ch03.ipynb -------------------------------------------------------------------------------- /ch03/01_main-chapter-code/exercise-solutions.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/01_main-chapter-code/exercise-solutions.ipynb -------------------------------------------------------------------------------- /ch03/01_main-chapter-code/multihead-attention.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/01_main-chapter-code/multihead-attention.ipynb -------------------------------------------------------------------------------- /ch03/01_main-chapter-code/small-text-sample.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/01_main-chapter-code/small-text-sample.txt -------------------------------------------------------------------------------- /ch03/02_bonus_efficient-multihead-attention/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/02_bonus_efficient-multihead-attention/README.md -------------------------------------------------------------------------------- /ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/02_bonus_efficient-multihead-attention/mha-implementations.ipynb -------------------------------------------------------------------------------- /ch03/03_understanding-buffers/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/03_understanding-buffers/README.md -------------------------------------------------------------------------------- /ch03/03_understanding-buffers/understanding-buffers.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/03_understanding-buffers/understanding-buffers.ipynb -------------------------------------------------------------------------------- /ch03/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch03/README.md -------------------------------------------------------------------------------- /ch04/01_main-chapter-code/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/01_main-chapter-code/README.md -------------------------------------------------------------------------------- /ch04/01_main-chapter-code/ch04.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/01_main-chapter-code/ch04.ipynb -------------------------------------------------------------------------------- /ch04/01_main-chapter-code/exercise-solutions.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/01_main-chapter-code/exercise-solutions.ipynb -------------------------------------------------------------------------------- /ch04/01_main-chapter-code/gpt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/01_main-chapter-code/gpt.py -------------------------------------------------------------------------------- /ch04/01_main-chapter-code/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/01_main-chapter-code/previous_chapters.py -------------------------------------------------------------------------------- /ch04/01_main-chapter-code/tests.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/01_main-chapter-code/tests.py -------------------------------------------------------------------------------- /ch04/02_performance-analysis/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/02_performance-analysis/README.md -------------------------------------------------------------------------------- /ch04/02_performance-analysis/flops-analysis.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/02_performance-analysis/flops-analysis.ipynb -------------------------------------------------------------------------------- /ch04/02_performance-analysis/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/02_performance-analysis/previous_chapters.py -------------------------------------------------------------------------------- /ch04/02_performance-analysis/requirements-extra.txt: -------------------------------------------------------------------------------- 1 | thop -------------------------------------------------------------------------------- /ch04/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch04/README.md -------------------------------------------------------------------------------- /ch05/01_main-chapter-code/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/01_main-chapter-code/README.md -------------------------------------------------------------------------------- /ch05/01_main-chapter-code/ch05.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/01_main-chapter-code/ch05.ipynb -------------------------------------------------------------------------------- /ch05/01_main-chapter-code/exercise-solutions.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/01_main-chapter-code/exercise-solutions.ipynb -------------------------------------------------------------------------------- /ch05/01_main-chapter-code/gpt_download.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/01_main-chapter-code/gpt_download.py -------------------------------------------------------------------------------- /ch05/01_main-chapter-code/gpt_generate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/01_main-chapter-code/gpt_generate.py -------------------------------------------------------------------------------- /ch05/01_main-chapter-code/gpt_train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/01_main-chapter-code/gpt_train.py -------------------------------------------------------------------------------- /ch05/01_main-chapter-code/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/01_main-chapter-code/previous_chapters.py -------------------------------------------------------------------------------- /ch05/01_main-chapter-code/tests.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/01_main-chapter-code/tests.py -------------------------------------------------------------------------------- /ch05/02_alternative_weight_loading/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/02_alternative_weight_loading/README.md -------------------------------------------------------------------------------- /ch05/02_alternative_weight_loading/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/02_alternative_weight_loading/previous_chapters.py -------------------------------------------------------------------------------- /ch05/02_alternative_weight_loading/weight-loading-hf-transformers.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/02_alternative_weight_loading/weight-loading-hf-transformers.ipynb -------------------------------------------------------------------------------- /ch05/03_bonus_pretraining_on_gutenberg/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/03_bonus_pretraining_on_gutenberg/README.md -------------------------------------------------------------------------------- /ch05/03_bonus_pretraining_on_gutenberg/prepare_dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/03_bonus_pretraining_on_gutenberg/prepare_dataset.py -------------------------------------------------------------------------------- /ch05/03_bonus_pretraining_on_gutenberg/pretraining_simple.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/03_bonus_pretraining_on_gutenberg/pretraining_simple.py -------------------------------------------------------------------------------- /ch05/03_bonus_pretraining_on_gutenberg/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/03_bonus_pretraining_on_gutenberg/previous_chapters.py -------------------------------------------------------------------------------- /ch05/03_bonus_pretraining_on_gutenberg/tests.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/03_bonus_pretraining_on_gutenberg/tests.py -------------------------------------------------------------------------------- /ch05/04_learning_rate_schedulers/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/04_learning_rate_schedulers/README.md -------------------------------------------------------------------------------- /ch05/05_bonus_hparam_tuning/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/05_bonus_hparam_tuning/README.md -------------------------------------------------------------------------------- /ch05/05_bonus_hparam_tuning/hparam_search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/05_bonus_hparam_tuning/hparam_search.py -------------------------------------------------------------------------------- /ch05/05_bonus_hparam_tuning/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/05_bonus_hparam_tuning/previous_chapters.py -------------------------------------------------------------------------------- /ch05/05_bonus_hparam_tuning/the-verdict.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/05_bonus_hparam_tuning/the-verdict.txt -------------------------------------------------------------------------------- /ch05/06_user_interface/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/06_user_interface/README.md -------------------------------------------------------------------------------- /ch05/06_user_interface/app_orig.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/06_user_interface/app_orig.py -------------------------------------------------------------------------------- /ch05/06_user_interface/app_own.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/06_user_interface/app_own.py -------------------------------------------------------------------------------- /ch05/06_user_interface/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/06_user_interface/previous_chapters.py -------------------------------------------------------------------------------- /ch05/06_user_interface/requirements-extra.txt: -------------------------------------------------------------------------------- 1 | chainlit>=1.2.0 -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/07_gpt_to_llama/README.md -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/07_gpt_to_llama/config.json -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/converting-gpt-to-llama2.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/07_gpt_to_llama/converting-gpt-to-llama2.ipynb -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/converting-llama2-to-llama3.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/07_gpt_to_llama/converting-llama2-to-llama3.ipynb -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/07_gpt_to_llama/previous_chapters.py -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/requirements-extra.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/07_gpt_to_llama/requirements-extra.txt -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/standalone-llama32.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/07_gpt_to_llama/standalone-llama32.ipynb -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/tests/test-requirements-extra.txt: -------------------------------------------------------------------------------- 1 | pytest>=8.1.1 2 | transformers>=4.44.2 3 | -------------------------------------------------------------------------------- /ch05/07_gpt_to_llama/tests/tests.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/07_gpt_to_llama/tests/tests.py -------------------------------------------------------------------------------- /ch05/08_memory_efficient_weight_loading/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/08_memory_efficient_weight_loading/README.md -------------------------------------------------------------------------------- /ch05/08_memory_efficient_weight_loading/memory-efficient-state-dict.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/08_memory_efficient_weight_loading/memory-efficient-state-dict.ipynb -------------------------------------------------------------------------------- /ch05/08_memory_efficient_weight_loading/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/08_memory_efficient_weight_loading/previous_chapters.py -------------------------------------------------------------------------------- /ch05/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch05/README.md -------------------------------------------------------------------------------- /ch06/01_main-chapter-code/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/01_main-chapter-code/README.md -------------------------------------------------------------------------------- /ch06/01_main-chapter-code/ch06.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/01_main-chapter-code/ch06.ipynb -------------------------------------------------------------------------------- /ch06/01_main-chapter-code/exercise-solutions.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/01_main-chapter-code/exercise-solutions.ipynb -------------------------------------------------------------------------------- /ch06/01_main-chapter-code/gpt_class_finetune.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/01_main-chapter-code/gpt_class_finetune.py -------------------------------------------------------------------------------- /ch06/01_main-chapter-code/gpt_download.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/01_main-chapter-code/gpt_download.py -------------------------------------------------------------------------------- /ch06/01_main-chapter-code/load-finetuned-model.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/01_main-chapter-code/load-finetuned-model.ipynb -------------------------------------------------------------------------------- /ch06/01_main-chapter-code/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/01_main-chapter-code/previous_chapters.py -------------------------------------------------------------------------------- /ch06/01_main-chapter-code/tests.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/01_main-chapter-code/tests.py -------------------------------------------------------------------------------- /ch06/02_bonus_additional-experiments/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/02_bonus_additional-experiments/README.md -------------------------------------------------------------------------------- /ch06/02_bonus_additional-experiments/additional_experiments.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/02_bonus_additional-experiments/additional_experiments.py -------------------------------------------------------------------------------- /ch06/02_bonus_additional-experiments/gpt_download.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/02_bonus_additional-experiments/gpt_download.py -------------------------------------------------------------------------------- /ch06/02_bonus_additional-experiments/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/02_bonus_additional-experiments/previous_chapters.py -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/README.md -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/download_prepare_dataset.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/download_prepare_dataset.py -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/gpt_download.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/gpt_download.py -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/previous_chapters.py -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/requirements-extra.txt: -------------------------------------------------------------------------------- 1 | transformers>=4.33.2 2 | scikit-learn>=1.3.0 -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/sklearn-baseline.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/sklearn-baseline.ipynb -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/train_bert_hf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/train_bert_hf.py -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/train_bert_hf_spam.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/train_bert_hf_spam.py -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/train_gpt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/train_gpt.py -------------------------------------------------------------------------------- /ch06/03_bonus_imdb-classification/train_sklearn_logreg.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/03_bonus_imdb-classification/train_sklearn_logreg.py -------------------------------------------------------------------------------- /ch06/04_user_interface/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/04_user_interface/README.md -------------------------------------------------------------------------------- /ch06/04_user_interface/app.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/04_user_interface/app.py -------------------------------------------------------------------------------- /ch06/04_user_interface/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/04_user_interface/previous_chapters.py -------------------------------------------------------------------------------- /ch06/04_user_interface/requirements-extra.txt: -------------------------------------------------------------------------------- 1 | chainlit>=1.2.0 -------------------------------------------------------------------------------- /ch06/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch06/README.md -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/README.md -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/ch07.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/ch07.ipynb -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/exercise-solutions.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/exercise-solutions.ipynb -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/exercise_experiments.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/exercise_experiments.py -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/gpt_download.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/gpt_download.py -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/gpt_instruction_finetuning.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/gpt_instruction_finetuning.py -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/instruction-data-with-response.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/instruction-data-with-response.json -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/instruction-data.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/instruction-data.json -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/load-finetuned-model.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/load-finetuned-model.ipynb -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/ollama_evaluate.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/ollama_evaluate.py -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/previous_chapters.py -------------------------------------------------------------------------------- /ch07/01_main-chapter-code/tests.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/01_main-chapter-code/tests.py -------------------------------------------------------------------------------- /ch07/02_dataset-utilities/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/02_dataset-utilities/README.md -------------------------------------------------------------------------------- /ch07/02_dataset-utilities/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/02_dataset-utilities/config.json -------------------------------------------------------------------------------- /ch07/02_dataset-utilities/create-passive-voice-entries.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/02_dataset-utilities/create-passive-voice-entries.ipynb -------------------------------------------------------------------------------- /ch07/02_dataset-utilities/find-near-duplicates.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/02_dataset-utilities/find-near-duplicates.py -------------------------------------------------------------------------------- /ch07/02_dataset-utilities/instruction-examples-modified.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/02_dataset-utilities/instruction-examples-modified.json -------------------------------------------------------------------------------- /ch07/02_dataset-utilities/instruction-examples.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/02_dataset-utilities/instruction-examples.json -------------------------------------------------------------------------------- /ch07/02_dataset-utilities/requirements-extra.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/02_dataset-utilities/requirements-extra.txt -------------------------------------------------------------------------------- /ch07/03_model-evaluation/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/README.md -------------------------------------------------------------------------------- /ch07/03_model-evaluation/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/config.json -------------------------------------------------------------------------------- /ch07/03_model-evaluation/eval-example-data.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/eval-example-data.json -------------------------------------------------------------------------------- /ch07/03_model-evaluation/llm-instruction-eval-ollama.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/llm-instruction-eval-ollama.ipynb -------------------------------------------------------------------------------- /ch07/03_model-evaluation/llm-instruction-eval-openai.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/llm-instruction-eval-openai.ipynb -------------------------------------------------------------------------------- /ch07/03_model-evaluation/requirements-extra.txt: -------------------------------------------------------------------------------- 1 | openai>=1.30.3 2 | tqdm>=4.65.0 3 | -------------------------------------------------------------------------------- /ch07/03_model-evaluation/scores/correlation-analysis.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/scores/correlation-analysis.ipynb -------------------------------------------------------------------------------- /ch07/03_model-evaluation/scores/gpt4-model-1-response.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/scores/gpt4-model-1-response.json -------------------------------------------------------------------------------- /ch07/03_model-evaluation/scores/gpt4-model-2-response.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/scores/gpt4-model-2-response.json -------------------------------------------------------------------------------- /ch07/03_model-evaluation/scores/llama3-8b-model-1-response.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/scores/llama3-8b-model-1-response.json -------------------------------------------------------------------------------- /ch07/03_model-evaluation/scores/llama3-8b-model-2-response.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/03_model-evaluation/scores/llama3-8b-model-2-response.json -------------------------------------------------------------------------------- /ch07/04_preference-tuning-with-dpo/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/04_preference-tuning-with-dpo/README.md -------------------------------------------------------------------------------- /ch07/04_preference-tuning-with-dpo/create-preference-data-ollama.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/04_preference-tuning-with-dpo/create-preference-data-ollama.ipynb -------------------------------------------------------------------------------- /ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/04_preference-tuning-with-dpo/dpo-from-scratch.ipynb -------------------------------------------------------------------------------- /ch07/04_preference-tuning-with-dpo/instruction-data-with-preference.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/04_preference-tuning-with-dpo/instruction-data-with-preference.json -------------------------------------------------------------------------------- /ch07/04_preference-tuning-with-dpo/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/04_preference-tuning-with-dpo/previous_chapters.py -------------------------------------------------------------------------------- /ch07/05_dataset-generation/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/05_dataset-generation/README.md -------------------------------------------------------------------------------- /ch07/05_dataset-generation/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/05_dataset-generation/config.json -------------------------------------------------------------------------------- /ch07/05_dataset-generation/instruction-data-llama3-7b.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/05_dataset-generation/instruction-data-llama3-7b.json -------------------------------------------------------------------------------- /ch07/05_dataset-generation/llama3-ollama.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/05_dataset-generation/llama3-ollama.ipynb -------------------------------------------------------------------------------- /ch07/05_dataset-generation/reflection-gpt4.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/05_dataset-generation/reflection-gpt4.ipynb -------------------------------------------------------------------------------- /ch07/05_dataset-generation/requirements-extra.txt: -------------------------------------------------------------------------------- 1 | openai>=1.30.3 2 | tqdm>=4.65.0 3 | -------------------------------------------------------------------------------- /ch07/06_user_interface/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/06_user_interface/README.md -------------------------------------------------------------------------------- /ch07/06_user_interface/app.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/06_user_interface/app.py -------------------------------------------------------------------------------- /ch07/06_user_interface/previous_chapters.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/06_user_interface/previous_chapters.py -------------------------------------------------------------------------------- /ch07/06_user_interface/requirements-extra.txt: -------------------------------------------------------------------------------- 1 | chainlit>=1.2.0 -------------------------------------------------------------------------------- /ch07/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/ch07/README.md -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/requirements.txt -------------------------------------------------------------------------------- /setup/.vscode/extensions.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/.vscode/extensions.json -------------------------------------------------------------------------------- /setup/01_optional-python-setup-preferences/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/01_optional-python-setup-preferences/README.md -------------------------------------------------------------------------------- /setup/02_installing-python-libraries/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/02_installing-python-libraries/README.md -------------------------------------------------------------------------------- /setup/02_installing-python-libraries/python_environment_check.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/02_installing-python-libraries/python_environment_check.ipynb -------------------------------------------------------------------------------- /setup/02_installing-python-libraries/python_environment_check.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/02_installing-python-libraries/python_environment_check.py -------------------------------------------------------------------------------- /setup/02_installing-python-libraries/tests.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/02_installing-python-libraries/tests.py -------------------------------------------------------------------------------- /setup/03_optional-docker-environment/.devcontainer/Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/03_optional-docker-environment/.devcontainer/Dockerfile -------------------------------------------------------------------------------- /setup/03_optional-docker-environment/.devcontainer/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/03_optional-docker-environment/.devcontainer/README.md -------------------------------------------------------------------------------- /setup/03_optional-docker-environment/.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/03_optional-docker-environment/.devcontainer/devcontainer.json -------------------------------------------------------------------------------- /setup/03_optional-docker-environment/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/03_optional-docker-environment/README.md -------------------------------------------------------------------------------- /setup/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/setup/README.md -------------------------------------------------------------------------------- /the-verdict.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/henrythe9th/LLMs-from-scratch/HEAD/the-verdict.txt --------------------------------------------------------------------------------