Skip to content

Commit

Permalink
feat: llama3 support
Browse files Browse the repository at this point in the history
Signed-off-by: Sertac Ozercan <[email protected]>
  • Loading branch information
sozercan committed Apr 18, 2024
1 parent 0b4a2d7 commit 4c745cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/aikit2llb/finetune/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"github.com/moby/buildkit/util/system"
"github.com/sozercan/aikit/pkg/aikit/config"
"github.com/sozercan/aikit/pkg/utils"
"github.com/sozercan/aikit/pkg/version"
"gopkg.in/yaml.v2"
)

const (
// https://github.com/unslothai/unsloth/releases/tag/February-2024
unslothCommitSHA = "dbba69b085b9d6049b57b48b882af7e9f29df5b2"
// https://github.com/unslothai/unsloth/releases/tag/April-Llama-3-2024
unslothCommitSHA = "88eee5026716a81e8f42a20fa83cae24eb35e45e"
nvidiaMknod = "mknod --mode 666 /dev/nvidiactl c 195 255 && mknod --mode 666 /dev/nvidia-uvm c 235 0 && mknod --mode 666 /dev/nvidia-uvm-tools c 235 1 && mknod --mode 666 /dev/nvidia0 c 195 0 && nvidia-smi"
sourceVenv = ". .venv/bin/activate"
)
Expand Down Expand Up @@ -49,7 +48,8 @@ func Aikit2LLB(c *config.FineTuneConfig) llb.State {
// uv does not support installing xformers via unsloth pyproject
state = state.Run(utils.Shf("pip install --upgrade pip uv && uv venv --system-site-packages && %[1]s && uv pip install packaging torch==2.1.0 ipython ninja packaging bitsandbytes setuptools wheel psutil && uv pip install flash-attn --no-build-isolation && python -m pip install 'unsloth[cu121_ampere] @ git+https://github.com/unslothai/unsloth.git@%[2]s'", sourceVenv, unslothCommitSHA)).Root()

version := version.Version
// version := version.Version
version := "llama3" // TODO: remove this
unslothScriptURL := fmt.Sprintf("https://raw.githubusercontent.com/sozercan/aikit/%s/pkg/finetune/target_unsloth.py", version)
var opts []llb.HTTPOption
opts = append(opts, llb.Chmod(0o755))
Expand Down
2 changes: 1 addition & 1 deletion test/aikitfile-unsloth.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#syntax=aikit:test
apiVersion: v1alpha1
baseModel: unsloth/llama-2-7b-bnb-4bit
baseModel: unsloth/llama-3-7b-bnb-4bit
datasets:
- source: "yahma/alpaca-cleaned"
type: alpaca
Expand Down

0 comments on commit 4c745cd

Please sign in to comment.