Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Llama Fine-tuning Support #194

Merged
merged 15 commits into from
Nov 1, 2023
Merged

Conversation

adam-weinberger
Copy link
Contributor

@adam-weinberger adam-weinberger commented Oct 19, 2023

@JegernOUTT
This pull request adds support for fine-tuning Code Llama 7b. The biggest update is in the supported_models.py file which adds the configurations for Code Llama. The second biggest update adds support for additional model configurations (in finetune_train_default.py and finetune_train.py). The other updates are minor and are mostly for logging.

To test this update from command line:

  1. Update the finetune.cfg file:
{
    "model_name": "codellama/7b",
    "use_heuristics": false,
    "train_steps": 75,
    "batch_size": 16,
    "save_every": 1
}
  1. Put your code files (easiest is a .zip of the repo) in the folder: ~/.refact/perm-storage/uploaded-files
  2. Run:
DEBUG=1 python -m refact.refact_data_pipeline.finetune.process_uploaded_files
DEBUG=1 python -m refact.refact_data_pipeline.finetune.finetune_filter
DEBUG=1 python -m refact.refact_data_pipeline.finetune.finetune_train
  1. Verify the model has trained correctly by checking the "status" is "finished" in .refact/perm-storage/loras/lora-YYYYmmDD-MMSSss/status.json

To test this update from the UI:

  1. Run:
DEBUG=1 python -m self_hosting_machinery.webgui.webgui
DEBUG=1 python -m self_hosting_machinery.inference.inference_worker --model codellama/7b
  1. On the Model Hosting select "codellama/7b". Click through the "Sources" and "Finetune" tabs as normal, being sure To select the "codellama/7b" model under "Start New Fine Tune". NOTE: sometimes portions of the UI are grayed out when I try to go through this workflow and I'm not always able to completed. Is this expected? I have not touched any of the UI code.
  2. Verify how the model has trained correctly by looking in the "Completed Runs"

@JegernOUTT JegernOUTT self-requested a review October 20, 2023 04:52
@JegernOUTT JegernOUTT self-requested a review November 1, 2023 06:56
@JegernOUTT
Copy link
Member

@adam-weinberger please, rebase your branch onto https://github.com/smallcloudai/refact/tree/v1.2.0 and resolve all conflicts

* Added multiple print statements for debugging fine tuning
* Added support for Code Llama 7b
* Depending on the training parameters I set I either get an out of memory GPU error or ValueError(“optimizer got an empty parameter list”)
@JegernOUTT JegernOUTT changed the base branch from main to v1.2.0 November 1, 2023 16:50
@JegernOUTT JegernOUTT merged commit dbb9fd9 into smallcloudai:v1.2.0 Nov 1, 2023
@klink klink linked an issue Nov 8, 2023 that may be closed by this pull request
mitya52 pushed a commit that referenced this pull request Nov 17, 2023
* Print statements for debugging and initial support for Code Llama

* Added multiple print statements for debugging fine tuning
* Added support for Code Llama 7b
* Depending on the training parameters I set I either get an out of memory GPU error or ValueError(“optimizer got an empty parameter list”)

* Code Llama fine-tuning but fails on checkpoint

* commenting print statements

* updating default config behavior

* Begin adding encoding for Code Llama

* adding BOS and EOS tokens for Code Llama, model running properly

* getting rid of #?

* Print statements for debugging and initial support for Code Llama

* Added multiple print statements for debugging fine tuning
* Added support for Code Llama 7b
* Depending on the training parameters I set I either get an out of memory GPU error or ValueError(“optimizer got an empty parameter list”)

* Code Llama fine-tuning but fails on checkpoint

* commenting print statements

* updating default config behavior

* Begin adding encoding for Code Llama

* adding BOS and EOS tokens for Code Llama, model running properly

* getting rid of #?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Code LLaMA
2 participants