Skip to content

langchain-chroma/store.py makes LocalAI crash  #636

@christiancadieux

Description

@christiancadieux

LocalAI version:
latest version quay.io/go-skynet/local-ai:latest on jun 19 6pm MT

Environment, CPU architecture, OS, and Version:
Linux rdei-local-ai-5f8fc75c56-z5lfb 5.4.77-flatcar #1 SMP Wed Nov 18 17:29:43 -00 2020 x86_64 GNU/Linux

Describe the bug
localAI log at the crash:

1:54PM DBG Loading model bert-embeddings from bert
11:54PM DBG Model already loaded in memory: bert
11:54PM DBG Loading model bert-embeddings from bert
11:54PM DBG Model already loaded in memory: bert
GGML_ASSERT: /build/go-bert/bert.cpp/ggml/src/ggml.c:6801: ggml_bert_nelements(dst) == ggml_bert_nelements(src0)
SIGABRT: abort
PC=0x7f55b5641ce1 m=5 sigcode=18446744073709551610
signal arrived during cgo execution

goroutine 98 [syscall]:
runtime.cgocall(0x9f7870, 0xc0006be768)
	/usr/local/go/src/runtime/cgocall.go:157 +0x5c fp=0xc0006be740 sp=0xc0006be708 pc=0x47b41c
github.com/go-skynet/go-bert%2ecpp._Cfunc_bert_token_embeddings(0x7f5360002b40, 0x7f5360000d60, 0x7f53600026d0, 0x1, 0xc000ac4000)
	_cgo_gotypes.go:168 +0x4c fp=0xc0006be768 sp=0xc0006be740 pc=0x8f998c
github.com/go-skynet/go-bert%2ecpp.(*Bert).TokenEmbeddings.func1(0x7f5360002b20?, 0x4?, 0x7f5360002b40?, {0xc0006df390?, 0x1, 0x0?}, 0x0?)
	/build/go-bert/gobert.go:70 +0x9d fp=0xc0006be7c8 sp=0xc0006be768 pc=0x8fa37d
github.com/go-skynet/go-bert%2ecpp.(*Bert).TokenEmbeddings(0x0?, {0xc0006df390?, 0x1, 0x1}, {0xc0006be8a8, 0x1, 0x0?})
	/build/go-bert/gobert.go:70 +0x190 fp=0xc0006be850 sp=0xc0006be7c8 pc=0x8fa150
github.com/go-skynet/LocalAI/api.ModelEmbedding.func2()
	/build/api/prediction.go:127 +0x85 fp=0xc0006be8c0 sp=0xc0006be850 pc=0x982ee5

...

CRASH
To Reproduce

called store.py from examples/langchain-chroma

$ python3 store.py 
Created a chunk of size 604, which is longer than the specified 300
Created a chunk of size 494, which is longer than the specified 300
Created a chunk of size 510, which is longer than the specified 300
Created a chunk of size 583, which is longer than the specified 300
Created a chunk of size 517, which is longer than the specified 300
Created a chunk of size 338, which is longer than the specified 300
Created a chunk of size 374, which is longer than the specified 300
Created a chunk of size 412, which is longer than the specified 300
Created a chunk of size 530, which is longer than the specified 300
Created a chunk of size 594, which is longer than the specified 300
Created a chunk of size 314, which is longer than the specified 300
Created a chunk of size 359, which is longer than the specified 300
Created a chunk of size 513, which is longer than the specified 300
Created a chunk of size 523, which is longer than the specified 300
Created a chunk of size 739, which is longer than the specified 300
Created a chunk of size 536, which is longer than the specified 300
Created a chunk of size 537, which is longer than the specified 300
Created a chunk of size 505, which is longer than the specified 300
Created a chunk of size 310, which is longer than the specified 300
Created a chunk of size 491, which is longer than the specified 300
Using embedded DuckDB with persistence: data will be stored in: db
Retrying langchain.embeddings.openai.embed_with_retry.<locals>._embed_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')).
Retrying langchain.embeddings.openai.embed_with_retry.<locals>._embed_with_retry in 4.0 seconds as it raised APIConnectionError: Error communicating with OpenAI: HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: /v1/engines/text-embedding-ada-002/embeddings (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbd80d2be50>: Failed to establish a new connection: [Errno 111] Connection refused')).
[[ CRASHED CONTAINER ]]

Expected behavior

Logs

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions