Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Sertac Ozercan <[email protected]>
  • Loading branch information
sozercan committed May 19, 2024
1 parent 6243ee4 commit e1e6bb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions pkg/aikit2llb/inference/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,23 @@ const (

localAIRepo = "https://github.com/mudler/LocalAI"
localAIVersion = "v2.15.0"
// temporary commit until v2.16.0, used for python backends

Check failure on line 21 in pkg/aikit2llb/inference/convert.go

View workflow job for this annotation

GitHub Actions / lint

Comment should end in a period (godot)
localAICommit = "e2de8a88f70d18291eb34ceb035be79dc73d3be6"
cudaVersion = "12-3"
cudaVersion = "12-3"
)

func Aikit2LLB(c *config.InferenceConfig) (llb.State, *specs.Image) {
var merge llb.State
state := llb.Image(utils.DebianSlim)
// base := getBaseImage(c)
base := getBaseImage(c)

// state, merge = copyModels(c, base, state)
state, merge = copyModels(c, base, state)
state, merge = addLocalAI(c, state, merge)

// // install cuda if runtime is nvidia
// if c.Runtime == utils.RuntimeNVIDIA {
// state, merge = installCuda(c, state, merge)
// }
// install cuda if runtime is nvidia
if c.Runtime == utils.RuntimeNVIDIA {
state, merge = installCuda(c, state, merge)
}

// install opencv and friends if stable diffusion backend is being used
for b := range c.Backends {
Expand Down
2 changes: 1 addition & 1 deletion pkg/aikit2llb/inference/exllama.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func installExllama(c *config.InferenceConfig, s llb.State, merge llb.State) llb
s = cloneLocalAI(s, backend)

// clone exllama to localai exllama backend path and install python dependencies
s = s.Run(utils.Bashf("git clone --depth 1 %[1]s --branch %[2]s /tmp/%[3]s && mv /tmp/%[3]s/* /tmp/localai/backend/python/%[3]s && rm -rf /tmp/%[3]s && cd /tmp/localai/backend/python/%[3]s && rm -rf .git && source $HOME/.cargo/env && python3 -m grpc_tools.protoc -I../.. --python_out=. --grpc_python_out=. backend.proto && uv venv && source .venv/bin/activate && ls -al && uv pip install --no-build-isolation --requirement requirements-install.txt && EXLLAMA_NOCOMPILE= uv pip install --no-build-isolation", exllamaRepo, exllamaTag, backend)).Root()
s = s.Run(utils.Bashf("git clone --depth 1 %[1]s --branch %[2]s /tmp/%[3]s && mv /tmp/%[3]s/* /tmp/localai/backend/python/%[3]s && rm -rf /tmp/%[3]s && cd /tmp/localai/backend/python/%[3]s && rm -rf .git && source $HOME/.cargo/env && python3 -m grpc_tools.protoc -I../.. --python_out=. --grpc_python_out=. backend.proto && uv venv && source .venv/bin/activate && ls -al && uv pip install --no-build-isolation --requirement requirements-install.txt && EXLLAMA_NOCOMPILE= uv pip install --no-build-isolation .", exllamaRepo, exllamaTag, backend)).Root()

diff := llb.Diff(savedState, s)
return llb.Merge([]llb.State{merge, diff})
Expand Down

0 comments on commit e1e6bb4

Please sign in to comment.