-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Quivr sometimes cannot reply to the content of documents I upload. #1712
Comments
🤖 Hello @hongruilin! I'm Dosu, a bot here to assist you with bugs, answer your questions, and guide you in contributing to Quivr. While we're waiting for a human maintainer to join us, I'm here to help you get started. Let's dive in and tackle this issue together. Based on the information you've provided, it seems like Quivr is intermittently unable to process the content of uploaded documents. This could be due to a variety of reasons, such as network issues, file format issues, or bugs in the code. From the context provided, I found a similar issue that was resolved: [Bug]: First installation, why is there no response?. This issue was about Quivr not responding after the first installation, which is somewhat similar to your issue of Quivr not responding to the content of uploaded documents. It might be helpful to look at the discussion and solution of this issue to see if it can provide any insights into your problem. Quivr uses the def upload_file_storage(file, file_identifier: str):
supabase_client: Client = get_supabase_client()
response = supabase_client.storage.from_("quivr").upload(file_identifier, file)
return response
class DocumentSerializable(Document):
page_content: str
metadata: dict = Field(default_factory=dict)
def to_json(self) -> str:
return json.dumps({"page_content": self.page_content, "metadata": self.metadata})
@classmethod
def from_json(cls, json_str: str):
data = json.loads(json_str)
return cls(page_content=data["page_content"], metadata=data["metadata"]) If the issue persists, it would be helpful if you could provide more information, such as the type and size of the documents you're uploading, the exact steps you're taking to upload and process the documents, and any error messages you're seeing in the logs. This will help us better understand and diagnose the problem. Sources |
I saw the message you sent me #1402 The problem is indeed the same, but I couldn't solve it either. Do you have any more practical suggestions? |
🤖 Based on the information you've provided, it seems like the issue might be related to the state of the One possible cause could be a race condition where the question is asked before the document content is fully processed and stored. This could explain why the second question can get a normal response, as by that time the processing might have completed. To debug this, you could add some logging in the def upload_file_storage(file, file_identifier: str):
supabase_client: Client = get_supabase_client()
response = supabase_client.storage.from_("quivr").upload(file_identifier, file)
print(f"Upload response: {response}") # Add logging
return response
class DocumentSerializable(Document):
page_content: str
metadata: dict = Field(default_factory=dict)
def to_json(self) -> str:
return json.dumps({"page_content": self.page_content, "metadata": self.metadata})
@classmethod
def from_json(cls, json_str: str):
data = json.loads(json_str)
print(f"Data from JSON: {data}") # Add logging
return cls(page_content=data["page_content"], metadata=data["metadata"]) This should give you more information about what's happening when the document content is being processed. If the issue persists, it would be helpful to know the exact version of Quivr you're using, as well as any error messages you're seeing in the console or logs. This will help narrow down the possible causes of the issue. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
I have observed that if I don't use my brain to send messages, Quivr will reply to them. Chat in Supabase database_ The assistant field of the history table will also be written to the content. But if I use my brain to ask questions, Quivr will reply with blank content. How can I fix the situation where there is no content written to the assistant field? |
🤖 Based on your description, it seems like there are two separate issues you're encountering with Quivr. Firstly, regarding the issue of Quivr not writing any content to the assistant field in the async for token in callback.aiter():
try:
logger.debug("Token: %s", token)
response_tokens.append(token)
streamed_chat_history.assistant = token
yield f"data: {json.dumps(streamed_chat_history.dict())}"
except Exception as e:
logger.error(f"Error during streaming: {e}") This will log any exceptions that occur during the streaming process, which should help you identify the issue. Secondly, regarding the intermittent issue of Quivr being unable to process the content of uploaded documents, the provided context does not contain enough information to identify the cause of the problem. The issue could be due to various factors such as file format, file size, or an error in the document processing code. Could you provide more information about the specific errors or issues you're encountering? For example, are there any error messages displayed when the issue occurs? What types of documents are you trying to upload (e.g., PDF, Word)? Are there specific documents that consistently cause the issue, or does it seem to occur randomly? This additional information will help in diagnosing the issue. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
I have redeployed Quivr and have not uploaded any documents. When I select the default brain to ask a question, it will return empty. If I do not select the default brain, it will reply normally. I have checked the server logs and obtained the following information backend-core | 2023-11-27 15:20:02,481 [INFO] repository.chat.create_chat: New chat entry in chats table for user f6420558-056f-4699-bb85-cf16960ce753 |
🤖 Hello @dosubot[bot], Nice to meet you! I'm here to help you with your questions and issues related to the Quivr project. I'm an AI bot designed to assist users like you while waiting for a human maintainer. Don't worry, we'll work on your issues together in the meantime. Let's get started, shall we? Based on the information you've provided, there could be several reasons why you're experiencing these issues. Let's tackle them one by one. Firstly, the issue where Quivr responds with blank content and fails to write to the assistant field in the To debug this issue, you should check the logs for any exceptions or errors that might have occurred during the execution of these methods. You should also add more logging statements to these methods to get more information about what's happening during their execution. If necessary, you could also write unit tests for these methods to ensure they're working as expected. You can find these methods in the backend/llm/qa_base.py file. Secondly, the issue where Quivr intermittently fails to process the content of uploaded documents. This could be due to an error in the Lastly, regarding the structure of the I hope this helps! If you need further assistance, please provide more information about the issues you're experiencing, such as any error messages you're seeing and the steps you're taking to reproduce these issues. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Thanks for your contributions, we'll be closing this issue as it has gone stale. Feel free to reopen if you'd like to continue the discussion. |
What happened?
Quivr sometimes cannot reply to the content of documents I upload. When I ask a question, the output content is empty, but the system log shows that the document content is being read normally. I immediately ask a second question, and Quivr can reply normally again. What is the reason why this often happens?
Relevant log output
No response
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered: