weaviate / Verba

Retrieval Augmented Generation (RAG) chatbot powered by Weaviate
BSD 3-Clause "New" or "Revised" License
5.98k stars 640 forks source link

Expecting value: line 1 column 1 (char 0) #209

Closed Kurskikh closed 1 week ago

Kurskikh commented 3 months ago

Hi. I want to use Ollama fully for answers and vectorization, but have run into a vectorization problem. I created an .env where I specified:

OLLAMA_URL=http://ollama.ai.local OLLAMA_MODEL=llama3:8b-instruct-q8_0 OLLAMA_EMBED_MODEL=nomic-embed-text:latest When I try to add a document using OllamaEmbedder I get:

(INFO) Importing... (INFO) Importing 1 files with BasicReader (INFO) Importing KSC HOWTOpdf.pdf (SUCCESS) Loaded 1 documents in 0.01s (INFO) Starting Chunking with TokenChunker (SUCCESS) Chunking completed with 2 chunks in 0.0s (INFO) Starting Embedding with OllamaEmbedder (ERROR) Expecting value: line 1 column 1 (char 0)

If you use ADA for vectorization and OLLAMA for response, everything is OK. Maybe somewhere in the code you can specify the vector length for the nomic-embed-text model?

Is this a bug or a feature? Bug

Steps to Reproduce Create an .env file with the following content:

OLLAMA_URL=http://ollama.ai.local OLLAMA_MODEL=llama3:8b-instruct-q8_0 OLLAMA_EMBED_MODEL=nomic-embed-text:latest Try to add a document using OllamaEmbedder. Observe the error. Additional context When using ADA for vectorization and OLLAMA for response, everything works fine. The issue might be related to the vector length specification for the nomic-embed-text:latest model.

thomashacker commented 3 months ago

Thanks for the issue, we'll look into it

NeverOccurs commented 3 months ago

using docker on windows, ada embedder and openai models get the following error when generating response:

verba-1 | ERROR: Exception in ASGI application verba-1 | Traceback (most recent call last): verba-1 | File "/usr/local/lib/python3.11/site-packages/openai/api_requestor.py", line 755, in _interpret_response_line verba-1 | data = json.loads(rbody) verba-1 | ^^^^^^^^^^^^^^^^^ verba-1 | File "/usr/local/lib/python3.11/json/init.py", line 346, in loads verba-1 | return _default_decoder.decode(s) verba-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ verba-1 | File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode verba-1 | obj, end = self.raw_decode(s, idx=_w(s, 0).end()) verba-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ verba-1 | File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode verba-1 | raise JSONDecodeError("Expecting value", s, err.value) from None verba-1 | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

thomashacker commented 3 months ago

I think, I saw that error recently, it was a problem with the .env having the wrong/incompatible quotations, can you double check that the values either have " or none quotes at all