emvecchi commited on
Commit
7334b8c
·
verified ·
1 Parent(s): 52e3e44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -288,10 +288,14 @@ def get_path():
288
  return f"{get_base_path()}/{st.session_state.current_index}.json"
289
 
290
  def display_dialogue(dialogue_path):
291
- with open(dialogue_path, "r", encoding="utf-8") as f:
292
- lines = f.readlines()
293
- for i, line in enumerate(lines, start=1):
294
- st.write(f"{i:03d}: {line.strip()}")
 
 
 
 
295
 
296
  def display_image(image_path):
297
  with hf_fs.open(image_path) as f:
 
288
  return f"{get_base_path()}/{st.session_state.current_index}.json"
289
 
290
  def display_dialogue(dialogue_path):
291
+ dialogue_text = load_text(dialogue_path)
292
+ st.markdown(
293
+ f"<details><summary><b>Annotation Guidelines</b></summary><div>{dialogue_text}</div></details><br>",
294
+ unsafe_allow_html=True)
295
+ #with open(dialogue_path, "r", encoding="utf-8") as f:
296
+ # lines = f.readlines()
297
+ #for i, line in enumerate(lines, start=1):
298
+ # st.write(f"{i:03d}: {line.strip()}")
299
 
300
  def display_image(image_path):
301
  with hf_fs.open(image_path) as f: