feministmystique commited on
Commit
3370d67
·
verified ·
1 Parent(s): 1de7f2f

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +11 -5
src/streamlit_app.py CHANGED
@@ -1,8 +1,15 @@
1
  import os, pathlib
2
- os.environ.setdefault("HOME", "/tmp")
3
- pathlib.Path("/tmp/.streamlit").mkdir(parents =True , exist_ok=True)
 
 
 
 
 
 
 
4
  import streamlit as st
5
- st.set_option("browser.gatherUsageStats", False)
6
  import time
7
  from huggingface_hub import InferenceClient
8
  import re
@@ -47,7 +54,6 @@ class ConfigManager:
47
  self.hf_token = os.getenv("HF_TOKEN")
48
  self.google_creds_json = os.getenv("GOOGLE_SHEETS_CREDENTIALS")
49
  self.google_sheets_id = os.getenv("GOOGLE_SHEETS_ID")
50
-
51
 
52
 
53
 
@@ -140,7 +146,7 @@ class AIAssistant:
140
 
141
  self.client = InferenceClient(
142
  model=self.model,
143
- token=token,
144
  timeout=60.0,
145
  )
146
 
 
1
  import os, pathlib
2
+ os.environ["HOME"] = "/app
3
+ cfg_dir = pathlib.Path(os.environ["HOME"]) / ".streamlit"
4
+ cfg_dir.mkdir(parents=True, exist_ok=True)
5
+
6
+ (cfg_dir / "config.toml").write_text (
7
+ "[browser]\n"
8
+ "gatherUsageStats = false\n",
9
+ encoding="utf-8"
10
+ )
11
  import streamlit as st
12
+
13
  import time
14
  from huggingface_hub import InferenceClient
15
  import re
 
54
  self.hf_token = os.getenv("HF_TOKEN")
55
  self.google_creds_json = os.getenv("GOOGLE_SHEETS_CREDENTIALS")
56
  self.google_sheets_id = os.getenv("GOOGLE_SHEETS_ID")
 
57
 
58
 
59
 
 
146
 
147
  self.client = InferenceClient(
148
  model=self.model,
149
+ token=None,
150
  timeout=60.0,
151
  )
152