SamarthPujari commited on
Commit
fcdcc81
·
verified ·
1 Parent(s): 7c1adae

Update Gradio_UI.py

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +3 -8
Gradio_UI.py CHANGED
@@ -42,15 +42,10 @@ class GradioUI:
42
  except IndexError:
43
  return "Error: Document Q&A tool not found at the expected index (4). Check agent tool setup in app.py."
44
  except Exception as e:
 
45
  print(f"Error during Document Q&A tool execution: {e}")
46
- # Optional: Clean up the uploaded file on error too
47
- # import os
48
- # try:
49
- # if os.path.exists(pdf_file.name):
50
- # os.remove(pdf_file.name)
51
- # print(f"Cleaned up file on error: {pdf_file.name}")
52
- # except Exception as e:
53
- # print(f"Error cleaning up file {pdf_file.name} on error: {e}")
54
  return f"An error occurred during Document Q&A: {str(e)}"
55
 
56
  # If no PDF file, or query is empty when file is present, handle as a general agent query
 
42
  except IndexError:
43
  return "Error: Document Q&A tool not found at the expected index (4). Check agent tool setup in app.py."
44
  except Exception as e:
45
+ import traceback # Add this import if it's not already at the top of the file
46
  print(f"Error during Document Q&A tool execution: {e}")
47
+ print("Full Traceback:")
48
+ print(traceback.format_exc()) # <--- ADD THIS LINE
 
 
 
 
 
 
49
  return f"An error occurred during Document Q&A: {str(e)}"
50
 
51
  # If no PDF file, or query is empty when file is present, handle as a general agent query