containers / podman-desktop-extension-ai-lab

Work with LLMs on a local environment using containers
https://podman-desktop.io/extensions/ai-lab
Apache License 2.0
183 stars 41 forks source link

rag_app.streamlit throwing exception #2160

Open yogeshpmandre opened 8 hours ago

yogeshpmandre commented 8 hours ago

Bug description

Issue Description I have create a RAG Chatbot (v1.3.0) using AI App in Podman Desktop (Version 1.14.1). The model I have used is instructlab/granite-7b-lab-CGUF. The RAG chatbot work properly if I query it. But when I upload a pdf and ask question based on the pdf, the app throws below expection error: Exception: {"error":"InvalidArgumentError","message":"Expected where to have exactly one operator, got {}"} (trace ID: 0)

Traceback: File "/opt/app-root/lib64/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script exec(code, module.dict) File "/rag/rag_app.py", line 101, in response = chain.invoke(prompt) ^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/runnables/base.py", line 2499, in invoke input = step.invoke( ^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/runnables/base.py", line 3142, in invoke output = {key: future.result() for key, future in zip(steps, futures)} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/runnables/base.py", line 3142, in output = {key: future.result() for key, future in zip(steps, futures)} ^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/concurrent/futures/_base.py", line 456, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.11/concurrent/futures/_base.py", line 401, in get_result raise self._exception File "/usr/lib64/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/retrievers.py", line 194, in invoke return self.get_relevant_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/_api/deprecation.py", line 148, in warning_emitting_wrapper return wrapped(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/retrievers.py", line 323, in get_relevant_documents raise e File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/retrievers.py", line 316, in get_relevant_documents result = self._get_relevant_documents( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/vectorstores.py", line 696, in _get_relevant_documents docs = self.vectorstore.similarity_search(query, self.search_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_community/vectorstores/chroma.py", line 349, in similarity_search docs_and_scores = self.similarity_search_with_score( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_community/vectorstores/chroma.py", line 439, in similarity_search_with_score results = self.__query_collection( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_core/utils/utils.py", line 36, in wrapper return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/langchain_community/vectorstores/chroma.py", line 156, in __query_collection return self._collection.query( ^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/chromadb/api/models/Collection.py", line 197, in query query_results = self._client._query( ^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/chromadb/telemetry/opentelemetry/init.py", line 146, in wrapper return f(*args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/chromadb/api/fastapi.py", line 500, in _query resp_json = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.11/site-packages/chromadb/api/fastapi.py", line 89, in _make_request BaseHTTPClient._raise_chroma_error(response) File "/opt/app-root/lib64/python3.11/site-packages/chromadb/api/base_http_client.py", line 103, in _raise_chroma_error raise Exception(f"{resp.text} (trace ID: {trace_id})")

Can somebody look into this issue?

Operating system

macOS Sequoia 15.1 (Chip Apple M1 Pro)

Installation Method

from Podman-Desktop extension page

Version

1.1.x

Steps to reproduce

  1. Install Podman Desktop, From receipt catalog download and configure RAG Chatbot, Assign resources and select model. Start service
  2. Upload any document in a pdf format
  3. Ask a query

Relevant log output

Additional context

No response