mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-05 16:51:36 +00:00
fix: symlink libphonemize in the container (#831)
This commit is contained in:
commit
688f150463
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -43,8 +43,8 @@ jobs:
|
|||||||
mkdir -p "lib/Linux-$(uname -m)/piper_phonemize" && \
|
mkdir -p "lib/Linux-$(uname -m)/piper_phonemize" && \
|
||||||
curl -L "https://github.com/rhasspy/piper-phonemize/releases/download/v1.0.0/libpiper_phonemize-amd64.tar.gz" | \
|
curl -L "https://github.com/rhasspy/piper-phonemize/releases/download/v1.0.0/libpiper_phonemize-amd64.tar.gz" | \
|
||||||
tar -C "lib/Linux-$(uname -m)/piper_phonemize" -xzvf - && ls -liah /build/lib/Linux-$(uname -m)/piper_phonemize/ && \
|
tar -C "lib/Linux-$(uname -m)/piper_phonemize" -xzvf - && ls -liah /build/lib/Linux-$(uname -m)/piper_phonemize/ && \
|
||||||
sudo cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/lib/. /lib64/ && \
|
|
||||||
sudo cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/lib/. /usr/lib/ && \
|
sudo cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/lib/. /usr/lib/ && \
|
||||||
|
sudo ln -s /usr/lib/libpiper_phonemize.so /usr/lib/libpiper_phonemize.so.1 && \
|
||||||
sudo cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/include/. /usr/include/
|
sudo cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/include/. /usr/include/
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
|
@ -63,8 +63,8 @@ RUN curl -L "https://github.com/gabime/spdlog/archive/refs/tags/v${SPDLOG_VERSIO
|
|||||||
mkdir -p "lib/Linux-$(uname -m)/piper_phonemize" && \
|
mkdir -p "lib/Linux-$(uname -m)/piper_phonemize" && \
|
||||||
curl -L "https://github.com/rhasspy/piper-phonemize/releases/download/v${PIPER_PHONEMIZE_VERSION}/libpiper_phonemize-${TARGETARCH:-$(go env GOARCH)}${TARGETVARIANT}.tar.gz" | \
|
curl -L "https://github.com/rhasspy/piper-phonemize/releases/download/v${PIPER_PHONEMIZE_VERSION}/libpiper_phonemize-${TARGETARCH:-$(go env GOARCH)}${TARGETVARIANT}.tar.gz" | \
|
||||||
tar -C "lib/Linux-$(uname -m)/piper_phonemize" -xzvf - && ls -liah /build/lib/Linux-$(uname -m)/piper_phonemize/ && \
|
tar -C "lib/Linux-$(uname -m)/piper_phonemize" -xzvf - && ls -liah /build/lib/Linux-$(uname -m)/piper_phonemize/ && \
|
||||||
cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/lib/. /lib64/ && \
|
|
||||||
cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/lib/. /usr/lib/ && \
|
cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/lib/. /usr/lib/ && \
|
||||||
|
ln -s /usr/lib/libpiper_phonemize.so /usr/lib/libpiper_phonemize.so.1 && \
|
||||||
cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/include/. /usr/include/
|
cp -rfv /build/lib/Linux-$(uname -m)/piper_phonemize/include/. /usr/include/
|
||||||
# \
|
# \
|
||||||
# ; fi
|
# ; fi
|
||||||
|
@ -33,7 +33,7 @@ type modelApplyRequest struct {
|
|||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Overrides map[string]string `json:"overrides"`
|
Overrides map[string]interface{} `json:"overrides"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func getModelStatus(url string) (response map[string]interface{}) {
|
func getModelStatus(url string) (response map[string]interface{}) {
|
||||||
@ -243,7 +243,7 @@ var _ = Describe("API test", func() {
|
|||||||
response := postModelApplyRequest("http://127.0.0.1:9090/models/apply", modelApplyRequest{
|
response := postModelApplyRequest("http://127.0.0.1:9090/models/apply", modelApplyRequest{
|
||||||
URL: "https://raw.githubusercontent.com/go-skynet/model-gallery/main/bert-embeddings.yaml",
|
URL: "https://raw.githubusercontent.com/go-skynet/model-gallery/main/bert-embeddings.yaml",
|
||||||
Name: "bert",
|
Name: "bert",
|
||||||
Overrides: map[string]string{
|
Overrides: map[string]interface{}{
|
||||||
"backend": "llama",
|
"backend": "llama",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -269,7 +269,7 @@ var _ = Describe("API test", func() {
|
|||||||
response := postModelApplyRequest("http://127.0.0.1:9090/models/apply", modelApplyRequest{
|
response := postModelApplyRequest("http://127.0.0.1:9090/models/apply", modelApplyRequest{
|
||||||
URL: "https://raw.githubusercontent.com/go-skynet/model-gallery/main/bert-embeddings.yaml",
|
URL: "https://raw.githubusercontent.com/go-skynet/model-gallery/main/bert-embeddings.yaml",
|
||||||
Name: "bert",
|
Name: "bert",
|
||||||
Overrides: map[string]string{},
|
Overrides: map[string]interface{}{},
|
||||||
})
|
})
|
||||||
|
|
||||||
Expect(response["uuid"]).ToNot(BeEmpty(), fmt.Sprint(response))
|
Expect(response["uuid"]).ToNot(BeEmpty(), fmt.Sprint(response))
|
||||||
@ -297,7 +297,7 @@ var _ = Describe("API test", func() {
|
|||||||
response := postModelApplyRequest("http://127.0.0.1:9090/models/apply", modelApplyRequest{
|
response := postModelApplyRequest("http://127.0.0.1:9090/models/apply", modelApplyRequest{
|
||||||
URL: "github:go-skynet/model-gallery/openllama_3b.yaml",
|
URL: "github:go-skynet/model-gallery/openllama_3b.yaml",
|
||||||
Name: "openllama_3b",
|
Name: "openllama_3b",
|
||||||
Overrides: map[string]string{"backend": "llama"},
|
Overrides: map[string]interface{}{"backend": "llama", "mmap": true, "f16": true, "context_size": 128},
|
||||||
})
|
})
|
||||||
|
|
||||||
Expect(response["uuid"]).ToNot(BeEmpty(), fmt.Sprint(response))
|
Expect(response["uuid"]).ToNot(BeEmpty(), fmt.Sprint(response))
|
||||||
@ -368,7 +368,6 @@ var _ = Describe("API test", func() {
|
|||||||
response := postModelApplyRequest("http://127.0.0.1:9090/models/apply", modelApplyRequest{
|
response := postModelApplyRequest("http://127.0.0.1:9090/models/apply", modelApplyRequest{
|
||||||
URL: "github:go-skynet/model-gallery/gpt4all-j.yaml",
|
URL: "github:go-skynet/model-gallery/gpt4all-j.yaml",
|
||||||
Name: "gpt4all-j",
|
Name: "gpt4all-j",
|
||||||
Overrides: map[string]string{},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
Expect(response["uuid"]).ToNot(BeEmpty(), fmt.Sprint(response))
|
Expect(response["uuid"]).ToNot(BeEmpty(), fmt.Sprint(response))
|
||||||
|
@ -17,9 +17,20 @@ type LLM struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (llm *LLM) Load(opts *pb.ModelOptions) error {
|
func (llm *LLM) Load(opts *pb.ModelOptions) error {
|
||||||
|
|
||||||
|
ropeFreqBase := float32(10000)
|
||||||
|
ropeFreqScale := float32(1)
|
||||||
|
|
||||||
|
if opts.RopeFreqBase != 0 {
|
||||||
|
ropeFreqBase = opts.RopeFreqBase
|
||||||
|
}
|
||||||
|
if opts.RopeFreqScale != 0 {
|
||||||
|
ropeFreqScale = opts.RopeFreqScale
|
||||||
|
}
|
||||||
|
|
||||||
llamaOpts := []llama.ModelOption{
|
llamaOpts := []llama.ModelOption{
|
||||||
llama.WithRopeFreqBase(opts.RopeFreqBase),
|
llama.WithRopeFreqBase(ropeFreqBase),
|
||||||
llama.WithRopeFreqScale(opts.RopeFreqScale),
|
llama.WithRopeFreqScale(ropeFreqScale),
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.ContextSize != 0 {
|
if opts.ContextSize != 0 {
|
||||||
@ -58,6 +69,15 @@ func (llm *LLM) Load(opts *pb.ModelOptions) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func buildPredictOptions(opts *pb.PredictOptions) []llama.PredictOption {
|
func buildPredictOptions(opts *pb.PredictOptions) []llama.PredictOption {
|
||||||
|
ropeFreqBase := float32(10000)
|
||||||
|
ropeFreqScale := float32(1)
|
||||||
|
|
||||||
|
if opts.RopeFreqBase != 0 {
|
||||||
|
ropeFreqBase = opts.RopeFreqBase
|
||||||
|
}
|
||||||
|
if opts.RopeFreqScale != 0 {
|
||||||
|
ropeFreqScale = opts.RopeFreqScale
|
||||||
|
}
|
||||||
predictOptions := []llama.PredictOption{
|
predictOptions := []llama.PredictOption{
|
||||||
llama.SetTemperature(opts.Temperature),
|
llama.SetTemperature(opts.Temperature),
|
||||||
llama.SetTopP(opts.TopP),
|
llama.SetTopP(opts.TopP),
|
||||||
@ -65,8 +85,8 @@ func buildPredictOptions(opts *pb.PredictOptions) []llama.PredictOption {
|
|||||||
llama.SetTokens(int(opts.Tokens)),
|
llama.SetTokens(int(opts.Tokens)),
|
||||||
llama.SetThreads(int(opts.Threads)),
|
llama.SetThreads(int(opts.Threads)),
|
||||||
llama.WithGrammar(opts.Grammar),
|
llama.WithGrammar(opts.Grammar),
|
||||||
llama.SetRopeFreqBase(opts.RopeFreqBase),
|
llama.SetRopeFreqBase(ropeFreqBase),
|
||||||
llama.SetRopeFreqScale(opts.RopeFreqScale),
|
llama.SetRopeFreqScale(ropeFreqScale),
|
||||||
llama.SetNegativePromptScale(opts.NegativePromptScale),
|
llama.SetNegativePromptScale(opts.NegativePromptScale),
|
||||||
llama.SetNegativePrompt(opts.NegativePrompt),
|
llama.SetNegativePrompt(opts.NegativePrompt),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user