iurbinah commited on
Commit
a02df87
·
verified ·
1 Parent(s): 03f2f4a

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +10 -0
src/streamlit_app.py CHANGED
@@ -7,12 +7,22 @@ from typing import Union
7
  # Ensure Streamlit can write its internal files in Spaces
8
  # -----------------------------------------------------
9
  TMP_HOME = tempfile.gettempdir()
 
 
 
 
 
 
 
10
  os.environ.setdefault("HOME", TMP_HOME)
11
  os.makedirs(os.path.join(TMP_HOME, ".streamlit"), exist_ok=True)
12
 
13
  import pandas as pd
14
  import streamlit as st
15
 
 
 
 
16
  # =====================================================
17
  # Configuration & Authentication
18
  # =====================================================
 
7
  # Ensure Streamlit can write its internal files in Spaces
8
  # -----------------------------------------------------
9
  TMP_HOME = tempfile.gettempdir()
10
+ # Force HOME to a writable tmp directory (override any existing)
11
+ os.environ["HOME"] = TMP_HOME
12
+ # Disable anonymous usage stats to avoid metrics file write
13
+ os.environ["STREAMLIT_BROWSER_GATHERUSAGESTATS"] = "false"
14
+ os.makedirs(os.path.join(TMP_HOME, ".streamlit"), exist_ok=True)
15
+ # -----------------------------------------------------
16
+ TMP_HOME = tempfile.gettempdir()
17
  os.environ.setdefault("HOME", TMP_HOME)
18
  os.makedirs(os.path.join(TMP_HOME, ".streamlit"), exist_ok=True)
19
 
20
  import pandas as pd
21
  import streamlit as st
22
 
23
+ import pandas as pd
24
+ import streamlit as st
25
+
26
  # =====================================================
27
  # Configuration & Authentication
28
  # =====================================================