https://github.com/lxe/simple-llama-finetuner Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} lxe / simple-llama-finetuner Public * Notifications * Fork 20 * Star 715 Simple UI for LLaMA Model Finetuning 715 stars 20 forks Star Notifications * Code * Issues 9 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights lxe/simple-llama-finetuner This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/l] Use Git or checkout with SVN using the web URL. [gh repo clone lxe/si] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @lxe lxe Refactor; fix model/lora loading/reloading in inference. Fixes # 10, #6 ... ecf29d8 Mar 22, 2023 Refactor; fix model/lora loading/reloading in inference. Fixes #10, # 6 ecf29d8 Git stats * 27 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .gitignore Refactor; fix model/lora loading/reloading in inference. Fixes #10, # 6 March 22, 2023 22:45 Inference.ipynb Refactor; fix model/lora loading/reloading in inference. Fixes #10, # 6 March 22, 2023 22:45 README.md Document Python 3.10 and conda create March 22, 2023 16:14 Simple_LLaMA_FineTuner.ipynb Added ipynb and another example March 21, 2023 20:53 main.py Refactor; fix model/lora loading/reloading in inference. Fixes #10, # 6 March 22, 2023 22:45 maya-example.txt Update maya-example.txt March 21, 2023 23:43 requirements.txt Update requirements.txt March 21, 2023 20:30 rlhf-mini-example.txt Initial commit March 21, 2023 20:14 View code [ ] Simple LLaMA Finetuner Acknowledgements Features TODO Getting Started Prerequisites Usage Screenshots License README.md Simple LLaMA Finetuner Open In Colab [6874747073] [6874747073] Simple LLaMA Finetuner is a beginner-friendly interface designed to facilitate fine-tuning the LLaMA-7B language model using LoRA method via the PEFT library on commodity NVIDIA GPUs. With small dataset and sample lengths of 256, you can even run this on a regular Colab Tesla T4 instance. With this intuitive UI, you can easily manage your dataset, customize parameters, train, and evaluate the model's inference capabilities. Acknowledgements * https://github.com/zphang/minimal-llama/ * https://github.com/tloen/alpaca-lora * https://github.com/huggingface/peft * https://huggingface.co/datasets/Anthropic/hh-rlhf Features * Simply paste datasets in the UI, separated by double blank lines * Adjustable parameters for fine-tuning and inference * Beginner-friendly UI with explanations for each parameter TODO * [ ] Accelerate / DeepSpeed * [ ] Load other models * [ ] More dataset preparation tools Getting Started Prerequisites * Linux or WSL * Modern NVIDIA GPU with >16 GB of VRAM (but it might be possible to run with less for smaller sample lengths) Usage I recommend using a virtual environment to install the required packages. Conda preferred conda create -n llama-finetuner python=3.10 conda activate llama-finetuner conda install -y cuda -c nvidia/label/cuda-11.7.0 conda install -y pytorch=1.13.1 pytorch-cuda=11.7 -c pytorch Clone the repository and install the required packages. git clone https://github.com/lxe/simple-llama-finetuner.git cd simple-llama-finetuner pip install -r requirements.txt Launch it python main.py Open http://127.0.0.1:7860/ in your browser. Prepare your training data by separating each sample with 2 blank lines. Paste the whole training dataset into the textbox. Specify the model name in the "LoRA Model Name" textbox, then click train. You might need to adjust the max sequence length and batch size to fit your GPU memory. The model will be saved in the lora-{your model name} directory. After training is done, navigate to "Inference" tab, click "Reload Models", select your model, and play with it. Have fun! Screenshots Image1 Image2 License MIT License Copyright (c) 2023 Aleksey Smolenchuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. About Simple UI for LLaMA Model Finetuning Resources Readme Stars 715 stars Watchers 13 watching Forks 20 forks Releases No releases published Packages 0 No packages published Contributors 3 * @lxe lxe Aleksey Smolenchuk * @vadi2 vadi2 Vadim Peretokin * @SimoMay SimoMay Mohamed Languages * Jupyter Notebook 61.3% * Python 38.7% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.