-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat-roles
- Loading branch information
Showing
11 changed files
with
220 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package cli | ||
|
||
import ( | ||
"os" | ||
"syscall" | ||
|
||
"github.com/go-skynet/LocalAI/pkg/assets" | ||
"github.com/rs/zerolog/log" | ||
) | ||
|
||
type LLAMACPPWorkerCMD struct { | ||
Args []string `arg:"" optional:"" name:"models" help:"Worker arguments: host port"` | ||
BackendAssetsPath string `env:"LOCALAI_BACKEND_ASSETS_PATH,BACKEND_ASSETS_PATH" type:"path" default:"/tmp/localai/backend_data" help:"Path used to extract libraries that are required by some of the backends in runtime" group:"storage"` | ||
} | ||
|
||
func (r *LLAMACPPWorkerCMD) Run(ctx *Context) error { | ||
// Extract files from the embedded FS | ||
err := assets.ExtractFiles(ctx.BackendAssets, r.BackendAssetsPath) | ||
log.Debug().Msgf("Extracting backend assets files to %s", r.BackendAssetsPath) | ||
if err != nil { | ||
log.Warn().Msgf("Failed extracting backend assets files: %s (might be required for some backends to work properly, like gpt4all)", err) | ||
} | ||
|
||
return syscall.Exec( | ||
assets.ResolvePath( | ||
r.BackendAssetsPath, | ||
"util", | ||
"llama-cpp-rpc-server", | ||
), | ||
append([]string{ | ||
assets.ResolvePath( | ||
r.BackendAssetsPath, | ||
"util", | ||
"llama-cpp-rpc-server", | ||
)}, r.Args...), | ||
os.Environ()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.