goatfahad commited on
Commit
48db8ca
·
verified ·
1 Parent(s): dd58357

fix: app.py for HF Spaces deployment

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -1,17 +1,18 @@
1
- import sys
2
- import os
3
- sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
4
-
5
- """Streamlit dashboard for The Human Condition v2.0."""
6
  from __future__ import annotations
7
 
8
  import json
 
 
 
 
9
  from pathlib import Path
10
 
11
  import numpy as np
12
  import pandas as pd
13
  import streamlit as st
14
 
 
 
15
  from human_condition.viz.charts import (
16
  apply_theme,
17
  compression_curve,
@@ -391,4 +392,4 @@ elif section == "Raw Data":
391
  for path in [RAW_DIR / "corpus.jsonl", FEATURES_DIR / "emotions.jsonl", FEATURES_DIR / "topic_info.jsonl"]:
392
  if path.exists():
393
  n_lines = sum(1 for _ in open(path, encoding="utf-8"))
394
- st.markdown(f"- **{path.name}**: {n_lines:,} records ({path.parent})")
 
 
 
 
 
 
1
  from __future__ import annotations
2
 
3
  import json
4
+ import sys
5
+ import os
6
+ sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src'))
7
+
8
  from pathlib import Path
9
 
10
  import numpy as np
11
  import pandas as pd
12
  import streamlit as st
13
 
14
+ """Streamlit dashboard for The Human Condition v2.0."""
15
+
16
  from human_condition.viz.charts import (
17
  apply_theme,
18
  compression_curve,
 
392
  for path in [RAW_DIR / "corpus.jsonl", FEATURES_DIR / "emotions.jsonl", FEATURES_DIR / "topic_info.jsonl"]:
393
  if path.exists():
394
  n_lines = sum(1 for _ in open(path, encoding="utf-8"))
395
+ st.markdown(f"- **{path.name}**: {n_lines:,} records ({path.parent})")