nikhmr1235 commited on
Commit
0163219
·
verified ·
1 Parent(s): 656e456

fix to update keyerror

Browse files

Traceback (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: 7

Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -153,7 +153,9 @@ with gr.Blocks(title="PDF Chatbot") as demo:
153
  textbox=gr.Textbox(placeholder="Type your question here...", scale=7),
154
  examples=["What is the main topic of the document?", "Summarize the key findings.", "Who are the authors?"],
155
  title="Chat Interface",
156
- theme="soft"
 
 
157
  )
158
 
159
  # Initially hide the chat interface until a file is processed
 
153
  textbox=gr.Textbox(placeholder="Type your question here...", scale=7),
154
  examples=["What is the main topic of the document?", "Summarize the key findings.", "Who are the authors?"],
155
  title="Chat Interface",
156
+ theme="soft",
157
+ # Fix: Add the state as an additional input to the ChatInterface
158
+ additional_inputs=[state]
159
  )
160
 
161
  # Initially hide the chat interface until a file is processed