mudler / LocalAI

:robot: The free, Open Source alternative to OpenAI, Claude and others. Self-hosted and local-first. Drop-in replacement for OpenAI, running on consumer-grade hardware. No GPU required. Runs gguf, transformers, diffusers and many more models architectures. Features: Generate Text, Audio, Video, Images, Voice Cloning, Distributed inference
https://localai.io
MIT License
23.45k stars 1.79k forks source link

Prebuilt image `/tts` reports an error #730

Open ddosakura opened 1 year ago

ddosakura commented 1 year ago

LocalAI version:

quay.io/go-skynet/local-ai:v1.20.0-cublas-cuda12-ffmpeg

Environment, CPU architecture, OS, and Version:

Linux 0f37a61ebb06 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 GNU/Linux

Describe the bug

Prebuilt image /tts reports an error

To Reproduce

REBUILD=false

Expected behavior

Logs

Error processing file '/tmp/localai/backend_data/backend-assets/espeak-ng-data/phontab': No such file or directory.

Additional context

May be caused by:

# Makefile
backend-assets/espeak-ng-data:
    mkdir -p backend-assets/espeak-ng-data
ifdef ESPEAK_DATA
    @cp -rf $(ESPEAK_DATA)/. backend-assets/espeak-ng-data
else
    @touch backend-assets/espeak-ng-data/keep
endif

cp is not executed

mudler commented 1 year ago

I didn't tried cublas images yet, but on standard ones it works here:

Install the model

Be sure to have started local-ai with GALLERIES=[{"name":"model-gallery", "url":"github:go-skynet/model-gallery/index.yaml"}]

and install it with:

curl $LOCALAI/models/apply -H "Content-Type: application/json" -d '{ "id": "model-gallery@voice-it-riccardo_fasol-x-low" }'

Test TTS

curl $LOCALAI/tts -H "Content-Type: application/json" -d '{                                                                
     "model":"it-riccardo_fasol-x-low.onnx",
     "input":"test"
   }' | aplay
localai-bot commented 1 year ago

:warning::warning::warning::warning::warning:

Hi! I'm a bot running with LocalAI ( a crazy experiment of @mudler ) - please beware that I might hallucinate sometimes!

_but.... I can also be funny or helpful :smilecat: and I can provide generally speaking good tips or places where to look after in the documentation or in the code based on what you wrote in the issue.

Don't engage in conversation with me, I don't support (yet) replying!

:warning::warning::warning::warning::warning:

Hi there! Thanks for providing this information. It looks like the issue might be caused by the fact that the cp command in the Makefile isn't being executed correctly. The error message you see, "Error processing file '/tmp/localai/backend_data/backend-assets/espeak-ng-data/phontab': No such file or directory," seems to suggest that there is no phontab file in the specified location, which could be caused by the cp command not working properly.

I'm not sure what version of the code this issue was found in, as that information wasn't provided in the context given. If you could let me know the LocalAI version that corresponds to the prebuilt image you were using when you encountered this bug, I could help provide a more accurate response. In any case, it sounds like there may be an error in the Makefile preventing cp from executing correctly. Have you tried rebuilding and running the code with the command line option --gpus all? If not, that might be a good next step to try.

Sources:

sebastien-prudhomme commented 1 year ago

Same kind of problem here with image 1.21.0-ffmpeg:

8:19AM DBG Loading model piper from voice-it-riccardo_fasol-x-low.onnx
8:19AM DBG Model already loaded in memory: voice-it-riccardo_fasol-x-low.onnx
8:19AM DBG GRPC Model not responding%!(EXTRA string=voice-it-riccardo_fasol-x-low.onnx)
8:19AM DBG GRPC Process is not responding%!(EXTRA string=voice-it-riccardo_fasol-x-low.onnx)
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp [::1]:40267: connect: connection refused"
8:19AM DBG Loading model in memory from file: /data/models/voice-it-riccardo_fasol-x-low.onnx
8:19AM DBG Loading GRPC Model%!(EXTRA string=piper, model.Options={piper voice-it-riccardo_fasol-x-low.onnx 0 /tmp/localai/backend_data 0xc00003e0a8 0xc00025a630})
8:19AM DBG Loading GRPC Process%!(EXTRA string=/tmp/localai/backend_data/backend-assets/grpc/piper)
8:19AM DBG GRPC Service for 'piper' (voice-it-riccardo_fasol-x-low.onnx) will be running at: 'localhost:43109'
8:19AM DBG GRPC Service Started
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp [::1]:43109: connect: connection refused"
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr 2023/07/19 08:19:41 gRPC Server listening at 127.0.0.1:43109
8:19AM DBG GRPC Service Ready
8:19AM DBG GRPC: Loading model with options: {state:{NoUnkeyedLiterals:{} DoNotCompare:[] DoNotCopy:[] atomicMessageInfo:<nil>} sizeCache:0 unknownFields:[] Model:/data/models/voice-it-riccardo_fasol-x-low.onnx ContextSize:0 Seed:0 NBatch:0 F16Memory:false MLock:false MMap:false VocabOnly:false LowVRAM:false Embeddings:false NUMA:false NGPULayers:0 MainGPU: TensorSplit: Threads:0 LibrarySearchPath:/tmp/localai/backend_data/backend-assets/espeak-ng-data}
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr terminate called after throwing an instance of 'nlohmann::json_abi_v3_11_2::detail::parse_error'
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   what():  [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr SIGABRT: abort
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr PC=0x7fb2c9630ce1 m=0 sigcode=18446744073709551610
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr signal arrived during cgo execution
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr 
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr goroutine 35 [syscall]:
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr runtime.cgocall(0x826a00, 0xc0000c78e8)
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc0000c78c0 sp=0xc0000c7888 pc=0x43987c
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr github.com/mudler/go-piper._Cfunc_piper_tts(0xda4ab0, 0xda4530, 0xda4b20, 0xd99c90, 0xda4b60)
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   _cgo_gotypes.go:78 +0x4c fp=0xc0000c78e8 sp=0xc0000c78c0 pc=0x82526c
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr github.com/mudler/go-piper.TextToWav({0xc0000b0180?, 0xac?}, {0xc0000e2030, 0x2f}, {0xc0000a0040, 0x37}, {0x0, 0x0}, {0xc0000a2020, 0x1f})
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /build/go-piper/piper.go:19 +0xea fp=0xc0000c7948 sp=0xc0000c78e8 pc=0x8254ca
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr github.com/go-skynet/LocalAI/pkg/grpc/tts.(*PiperB).TTS(...)
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /build/pkg/grpc/tts/piper.go:43
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr github.com/go-skynet/LocalAI/pkg/grpc/tts.(*Piper).TTS(0x0?, 0x7fb2c945a5b8?)
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /build/pkg/grpc/tts/piper.go:26 +0x4d fp=0xc0000c79a8 sp=0xc0000c7948 pc=0x8256ad
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr github.com/go-skynet/LocalAI/pkg/grpc.(*server).TTS(0x92d140?, {0xc000096180?, 0x5f0ca6?}, 0x0?)
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /build/pkg/grpc/server.go:63 +0x28 fp=0xc0000c7a10 sp=0xc0000c79a8 pc=0x825f48
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr github.com/go-skynet/LocalAI/pkg/grpc/proto._Backend_TTS_Handler({0x930b80?, 0xc000061e80}, {0xa13830, 0xc000094ba0}, 0xc0000ae3f0, 0x0)
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /build/pkg/grpc/proto/backend_grpc.pb.go:329 +0x170 fp=0xc0000c7a68 sp=0xc0000c7a10 pc=0x824050
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr google.golang.org/grpc.(*Server).processUnaryRPC(0xc00018a3c0, {0xa164b8, 0xc000280820}, 0xc0000ac240, 0xc000190f90, 0xcd7790, 0x0)
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /go/pkg/mod/google.golang.org/grpc@v1.56.2/server.go:1337 +0xdf3 fp=0xc0000c7e48 sp=0xc0000c7a68 pc=0x80c273
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr google.golang.org/grpc.(*Server).handleStream(0xc00018a3c0, {0xa164b8, 0xc000280820}, 0xc0000ac240, 0x0)
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /go/pkg/mod/google.golang.org/grpc@v1.56.2/server.go:1714 +0xa36 fp=0xc0000c7f68 sp=0xc0000c7e48 pc=0x811396
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr google.golang.org/grpc.(*Server).serveStreams.func1.1()
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /go/pkg/mod/google.golang.org/grpc@v1.56.2/server.go:959 +0x98 fp=0xc0000c7fe0 sp=0xc0000c7f68 pc=0x809c78
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr runtime.goexit()
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /usr/local/go/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000c7fe8 sp=0xc0000c7fe0 pc=0x49c341
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr created by google.golang.org/grpc.(*Server).serveStreams.func1
8:19AM DBG GRPC(piper-voice-it-riccardo_fasol-x-low.onnx-localhost:43109): stderr   /go/pkg/mod/google.golang.org/grpc@v1.56.2/server.go:957 +0x18c