nolzZ commited on
Commit
6166677
·
verified ·
1 Parent(s): ab806bf

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +5 -3
src/streamlit_app.py CHANGED
@@ -7,10 +7,12 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipe
7
  import os
8
  import zipfile
9
 
10
- # แตกไฟล์ zip ถ้ายังไม่มีโฟลเดอร์
11
  if not os.path.exists("Senti_real"):
12
- with zipfile.ZipFile("Senti_real.zip", "r") as zip_ref:
13
- zip_ref.extractall()
 
 
 
14
 
15
  # ---------- CONFIG ----------
16
  st.set_page_config(page_title="CheckPD Sentiment Dashboard", layout="wide")
 
7
  import os
8
  import zipfile
9
 
 
10
  if not os.path.exists("Senti_real"):
11
+ base_path = os.path.dirname(os.path.dirname(__file__)) # ขึ้นจาก src ไป root
12
+ zip_path = os.path.join(base_path, "Senti_real.zip")
13
+ with zipfile.ZipFile(zip_path, "r") as zip_ref:
14
+ zip_ref.extractall(base_path)
15
+
16
 
17
  # ---------- CONFIG ----------
18
  st.set_page_config(page_title="CheckPD Sentiment Dashboard", layout="wide")