maom commited on
Commit
cb5b6a1
·
verified ·
1 Parent(s): 9994921

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +6 -1
src/streamlit_app.py CHANGED
@@ -1,6 +1,11 @@
1
  import streamlit as st
2
  from pathlib import Path
3
 
 
 
 
 
 
4
  SECTIONS = {
5
  "Identify dataset": "01_identify_dataset.md",
6
  "Getting started with HuggingFace": "02_getting_started_hf.md",
@@ -20,7 +25,7 @@ st.set_page_config(
20
  st.sidebar.title("Dataset Curation Guide")
21
  choice = st.sidebar.radio("Navigate", list(SECTIONS.keys()))
22
 
23
- md_path = Path("../sections") / SECTIONS[choice]
24
 
25
  if md_path.exists():
26
  st.markdown(md_path.read_text(), unsafe_allow_html=True)
 
1
  import streamlit as st
2
  from pathlib import Path
3
 
4
+ APP_DIR = Path(__file__).resolve().parent # src/
5
+ REPO_ROOT = APP_DIR.parent # repo root
6
+ SECTIONS_DIR = REPO_ROOT / "sections"
7
+
8
+
9
  SECTIONS = {
10
  "Identify dataset": "01_identify_dataset.md",
11
  "Getting started with HuggingFace": "02_getting_started_hf.md",
 
25
  st.sidebar.title("Dataset Curation Guide")
26
  choice = st.sidebar.radio("Navigate", list(SECTIONS.keys()))
27
 
28
+ md_path = SECTIONS_DIR / SECTIONS[choice]
29
 
30
  if md_path.exists():
31
  st.markdown(md_path.read_text(), unsafe_allow_html=True)