small deployment fixes
This commit is contained in:
parent
413b8e714d
commit
4b381f7073
2 changed files with 6 additions and 2 deletions
4
Makefile
4
Makefile
|
|
@ -7,6 +7,10 @@ build:
|
||||||
run: build
|
run: build
|
||||||
./${BINARY_NAME}
|
./${BINARY_NAME}
|
||||||
|
|
||||||
|
install: build
|
||||||
|
cp ${BINARY_NAME} ..
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
cd pkg/llama && make clean
|
||||||
go clean
|
go clean
|
||||||
rm ${BINARY_NAME}
|
rm ${BINARY_NAME}
|
||||||
4
main.go
4
main.go
|
|
@ -28,7 +28,6 @@ func main() {
|
||||||
config.SetDefault("prefix", "!")
|
config.SetDefault("prefix", "!")
|
||||||
config.SetDefault("model", "models/ggml-vicuna-7b-1.1-q4_0.bin")
|
config.SetDefault("model", "models/ggml-vicuna-7b-1.1-q4_0.bin")
|
||||||
config.SetDefault("name", "Kevin")
|
config.SetDefault("name", "Kevin")
|
||||||
config.SetDefault("threads", 1)
|
|
||||||
config.SetDefault("discord.token", "not-set")
|
config.SetDefault("discord.token", "not-set")
|
||||||
config.SetDefault("discord.chat", "not-set")
|
config.SetDefault("discord.chat", "not-set")
|
||||||
config.SetDefault("discord.owner", "not-set")
|
config.SetDefault("discord.owner", "not-set")
|
||||||
|
|
@ -64,6 +63,7 @@ func main() {
|
||||||
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
|
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
|
||||||
<-sc
|
<-sc
|
||||||
discord.Close()
|
discord.Close()
|
||||||
|
brain.Free()
|
||||||
}
|
}
|
||||||
|
|
||||||
func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
|
|
@ -88,7 +88,7 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||||
message := structs.NewMessage(m.Author.Username, strings.TrimSpace(m.Content))
|
message := structs.NewMessage(m.Author.Username, strings.TrimSpace(m.Content))
|
||||||
prompt := structs.GeneratePrompt(config, messages, *message)
|
prompt := structs.GeneratePrompt(config, messages, *message)
|
||||||
var seed int = int(time.Now().Unix())
|
var seed int = int(time.Now().Unix())
|
||||||
res, err := brain.Predict(prompt, llama.SetThreads(viper.GetInt("threads")), llama.SetTokens(128), llama.SetTopK(90), llama.SetTopP(0.86), llama.SetSeed(seed))
|
res, err := brain.Predict(prompt, llama.SetThreads(4), llama.SetTokens(128), llama.SetTopK(90), llama.SetTopP(0.86), llama.SetSeed(seed))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue