Spaces:
Sleeping
Sleeping
Commit History
-
fix ValueError below
Verified signatureFile "/home/user/app/app.py", line 154, in chat_with_pdf for user_msg, ai_msg in history: ValueError: too many values to unpack (expected 2)480beb6 -
fix to handle error: ValueError: Returned dictionary included some keys as Components. Either all keys must be Components to assign Component values, or return a List of values to assign output values in order.
Verified signature5070fef -
fix state propagation issue between process_pdf() and chat_withdoc()
Verified signaturef11f97c -
add conversation history (MULTI-turn conversation support)
Verified signature22dd68c -
adding gr.Info messages during the PDF processing and also improved the error handling to display messages in the UI if something goes wrong.
Verified signature9cc9353
-
+ self-cleaning logic
Verified signatureapplication will automatically clear out all old database directories every time it starts up, and it will continue to clean up any session directories that have been idle for more than three hours while it's running. This makes the application much more robust and suitable for a shared environment like Hugging Face Spaces.2b5cccc -
fix issue of seeing context from previously uploaded doc due to gradio state being shared incorrectly
Verified signaturef5dabf5 -
fix invalid syntax error:
Verified signature965a01e -
explicity pass the GOOGle-api key to llm and embedding model to resolve the 503 Illegal metadata and timeout errors
Verified signature9a69935 -
change chat funcs to be async funcs
Verified signatureThis is a classic asyncio error. It's happening because the Google Generative AI library uses asynchronous code for its API calls, but the Gradio event handlers (process_pdf and chat_with_pdf) are currently synchronous functions. When the synchronous function tries to run the async code, it can't find the necessary "event loop," causing the crash. The solution is to make our Gradio handlers asynchronous, which is fully supported. This involves: 1. Changing process_pdf and chat_with_pdf to be async def functions. 2. Using the asynchronous versions of the LangChain methods (afrom_documents and ainvoke). 3. Making the Gradio upload handler (process_and_show_chat) an async def function as well.13931f8 -
fix to create a uniquely named collection for each PDF upload session, to ensue concurrent user data is properly isolated.
Verified signature8b441cf -
remove nest_asyncio to fix deployment issue
Verified signature42c67b1 -
swicth from BAAI/bge-large-en-v1.5 to google generative model
Verified signature124f540 -
update to remove specific port binding for app
Verified signaturec89d558
-
find_available_port()
Verified signaturec9d2c90 -
let the app choose os.environ["GRADIO_SERVER_PORT"] = "7861-7870"
Verified signature60bbf45 -
trying server port: 7861 since 7860 is unavailable
Verified signature95ba3b6 -
add nest_asyncio
Verified signature5865dab -
additional print statements
Verified signature78d7b7f -
fix indentation issue
Verified signatured64bbb5 -
add some debug print statements to debug the state,db being unavaiable in chat_with_pdf()
Verified signaturea68a0ec -
fix to handle state.db being intied properly in process_pdf function
Verified signature886337d -
attempt to fix UI issue
Verified signaturefix info: create a row containing the chat interface and initially makes it invisible. When a PDF file is uploaded, the row becomes visible, showing the chat interface.fb9812a -
attempt 3 to fix UI visbility issue
Verified signaturebdb02ff -
attempt to fix chatinterface being invisble after file uploaded
Verified signature3aacd49 -
attempt to fix UI upload file function update
Verified signature2eb2e08 -
fix for chatinterface not being visible post successful PDF upload
Verified signature054e6c6 -
fix for The gr.ChatInterface component does not have a visible parameter
Verified signaturefix info: the gr.ChatInterface is wrapped in a gr.Group component named chat_group. The visible parameter is applied to the chat_group instead of the chat_interface. The file_upload_input.upload event now updates the visibility of the chat_group instead of the chat_interface.f6f31a0 -
attempt to fix keyerror:7 on global state object
Verified signatureThe additional_inputs parameter in gr.ChatInterface doesn't directly support gr.State objects the way it is being used Instead, we need to encapsulate state and functions within a class79ff6ae -
attempt to fix keyError:7 for global object:state
Verified signaturebc68e2a -
fix KeyError: 7 becasue of state object being re-intialised within process_pdf()
Verified signature0215574 -
attempt to fix AttributeError: 'function' object has no attribute 'is_db_ready' + PDF validation to limit file size <75MB only
Verified signature9dcff61 -
fix for ValueError below
Verified signatureraise ValueError( ValueError: Examples must be a list of lists when additional inputs are provided.187f700 -
fix to update keyerror
Verified signatureTraceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 667, in process_events response = await route_utils.call_process_api( File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 349, in call_process_api output = await app.get_blocks().process_api( File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 2284, in process_api data = await self.postprocess_data(block_fn, result["prediction"], state) File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 2038, in postprocess_data kwargs = state[block._id].constructor_args.copy() File "/usr/local/lib/python3.10/site-packages/gradio/state_holder.py", line 84, in __getitem__ block = self.blocks_config.blocks[key] KeyError: 70163219 -
fix for AttributeError
Verified signatureif not state.is_db_ready(): AttributeError: 'NoneType' object has no attribute 'is_db_ready'656e456 -
fix for AttributeError: 'NoneType' object has no attribute 'is_db_ready'
Verified signatureFile "/home/user/app/app.py", line 95, in chat_with_pdf if not state.is_db_ready(): AttributeError: 'NoneType' object has no attribute 'is_db_ready'e2cd7fd -
fix for /home/user/app/app.py:157: UserWarning: You have not specified a value for the `type` parameter. Defaulting to the 'tuples' format for chatbot messages, but this is deprecated and will be removed in a future version of Gradio. Please set type='messages' instead,
Verified signature76c4d45 -
update to fix ModuleNotFoundError: No module named 'PyMuPDF'
Verified signaturefebca85 -
add GOOGLE_API_KEY key environment variable
Verified signature32f81ad -
Application file with Gradio UI to upload PDF and chatbot interface for Q&A on the PDF document
Verified signature-- User Interface (Gradio): The interface will be an "all-in-one" single-page layout. - It will feature a clear file upload area for PDF documents at the top. - Below the upload area, a chat interface will be present. - the chat interface will be "disabled by default". It will only become active and usable after a PDF has been successfully uploaded and processed. - similarly PDF upload interface will be disabled after chat interface is enabled1f44a86