Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- 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 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
| 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")
|