19arjun89 commited on
Commit
eb04400
·
verified ·
1 Parent(s): 7bd4a1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -10,6 +10,15 @@ from typing import List, Dict
10
  import os
11
  import tempfile
12
  import re
 
 
 
 
 
 
 
 
 
13
 
14
  # Initialize embeddings
15
  embeddings = HuggingFaceEmbeddings()
@@ -727,6 +736,11 @@ def create_interface():
727
  outputs=email_output
728
  )
729
 
 
 
 
 
 
730
  return app
731
 
732
  if __name__ == "__main__":
 
10
  import os
11
  import tempfile
12
  import re
13
+ import os
14
+
15
+ def storage_debug():
16
+ return {
17
+ "data_exists": os.path.exists("/data"),
18
+ "data_writable": os.access("/data", os.W_OK) if os.path.exists("/data") else False,
19
+ "cwd": os.getcwd(),
20
+ "files_in_data": os.listdir("/data") if os.path.exists("/data") else []
21
+ }
22
 
23
  # Initialize embeddings
24
  embeddings = HuggingFaceEmbeddings()
 
736
  outputs=email_output
737
  )
738
 
739
+ with gr.Accordion("Debug (temporary)", open=False):
740
+ dbg_btn = gr.Button("Check storage")
741
+ dbg_out = gr.JSON(label="Storage debug output")
742
+ dbg_btn.click(storage_debug, inputs=[], outputs=dbg_out)
743
+
744
  return app
745
 
746
  if __name__ == "__main__":