mirror of
https://github.com/mudler/LocalAI.git
synced 2025-01-31 00:24:54 +00:00
Add compatibility to gpt4all models
This commit is contained in:
parent
17b1724f7c
commit
650a22aef1
2
go.mod
2
go.mod
@ -6,7 +6,7 @@ require (
|
|||||||
github.com/charmbracelet/bubbles v0.15.0
|
github.com/charmbracelet/bubbles v0.15.0
|
||||||
github.com/charmbracelet/bubbletea v0.23.2
|
github.com/charmbracelet/bubbletea v0.23.2
|
||||||
github.com/charmbracelet/lipgloss v0.7.1
|
github.com/charmbracelet/lipgloss v0.7.1
|
||||||
github.com/go-skynet/llama v0.0.0-20230325223742-a3563a2690ba
|
github.com/go-skynet/llama v0.0.0-20230329165201-84efc8db3647
|
||||||
github.com/gofiber/fiber/v2 v2.42.0
|
github.com/gofiber/fiber/v2 v2.42.0
|
||||||
github.com/urfave/cli/v2 v2.25.0
|
github.com/urfave/cli/v2 v2.25.0
|
||||||
)
|
)
|
||||||
|
2
go.sum
2
go.sum
@ -23,6 +23,8 @@ github.com/go-skynet/llama v0.0.0-20230321172246-7be5326e18cc h1:NcmO8mA7iRZIX0Q
|
|||||||
github.com/go-skynet/llama v0.0.0-20230321172246-7be5326e18cc/go.mod h1:ZtYsAIud4cvP9VTTI9uhdgR1uCwaO/gGKnZZ95h9i7w=
|
github.com/go-skynet/llama v0.0.0-20230321172246-7be5326e18cc/go.mod h1:ZtYsAIud4cvP9VTTI9uhdgR1uCwaO/gGKnZZ95h9i7w=
|
||||||
github.com/go-skynet/llama v0.0.0-20230325223742-a3563a2690ba h1:u6OhAqlWFHsTjfWKePdK2kP4/mTyXX5vsmKwrK5QX6o=
|
github.com/go-skynet/llama v0.0.0-20230325223742-a3563a2690ba h1:u6OhAqlWFHsTjfWKePdK2kP4/mTyXX5vsmKwrK5QX6o=
|
||||||
github.com/go-skynet/llama v0.0.0-20230325223742-a3563a2690ba/go.mod h1:ZtYsAIud4cvP9VTTI9uhdgR1uCwaO/gGKnZZ95h9i7w=
|
github.com/go-skynet/llama v0.0.0-20230325223742-a3563a2690ba/go.mod h1:ZtYsAIud4cvP9VTTI9uhdgR1uCwaO/gGKnZZ95h9i7w=
|
||||||
|
github.com/go-skynet/llama v0.0.0-20230329165201-84efc8db3647 h1:W6qHHD/Bv6wRXSzdv38gWMAXgw3fklHyEblfw88uEUU=
|
||||||
|
github.com/go-skynet/llama v0.0.0-20230329165201-84efc8db3647/go.mod h1:ZtYsAIud4cvP9VTTI9uhdgR1uCwaO/gGKnZZ95h9i7w=
|
||||||
github.com/gofiber/fiber/v2 v2.42.0 h1:Fnp7ybWvS+sjNQsFvkhf4G8OhXswvB6Vee8hM/LyS+8=
|
github.com/gofiber/fiber/v2 v2.42.0 h1:Fnp7ybWvS+sjNQsFvkhf4G8OhXswvB6Vee8hM/LyS+8=
|
||||||
github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc=
|
github.com/gofiber/fiber/v2 v2.42.0/go.mod h1:3+SGNjqMh5VQH5Vz2Wdi43zTIV16ktlFd3x3R6O1Zlc=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||||
|
14
main.go
14
main.go
@ -36,7 +36,9 @@ func llamaFromOptions(ctx *cli.Context) (*llama.LLama, error) {
|
|||||||
if ctx.Bool("alpaca") {
|
if ctx.Bool("alpaca") {
|
||||||
opts = append(opts, llama.EnableAlpaca)
|
opts = append(opts, llama.EnableAlpaca)
|
||||||
}
|
}
|
||||||
|
if ctx.Bool("gpt4all") {
|
||||||
|
opts = append(opts, llama.EnableGPT4All)
|
||||||
|
}
|
||||||
return llama.New(ctx.String("model"), opts...)
|
return llama.New(ctx.String("model"), opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +97,11 @@ var modelFlags = []cli.Flag{
|
|||||||
EnvVars: []string{"ALPACA"},
|
EnvVars: []string{"ALPACA"},
|
||||||
Value: true,
|
Value: true,
|
||||||
},
|
},
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "gpt4all",
|
||||||
|
EnvVars: []string{"GPT4ALL"},
|
||||||
|
Value: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -168,6 +175,11 @@ echo "An Alpaca (Vicugna pacos) is a domesticated species of South American came
|
|||||||
EnvVars: []string{"ALPACA"},
|
EnvVars: []string{"ALPACA"},
|
||||||
Value: true,
|
Value: true,
|
||||||
},
|
},
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "gpt4all",
|
||||||
|
EnvVars: []string{"GPT4ALL"},
|
||||||
|
Value: false,
|
||||||
|
},
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "context-size",
|
Name: "context-size",
|
||||||
EnvVars: []string{"CONTEXT_SIZE"},
|
EnvVars: []string{"CONTEXT_SIZE"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user