khaerens commited on
Commit
bf84d89
1 Parent(s): 2c926e1
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -100,7 +100,7 @@ def free_text_generate():
100
  st.session_state["GRAPH_FILENAME"] = str(dt.now().timestamp()*1000) + ".html"
101
  text = st.session_state['free_text'][0:500]
102
  rebel.generate_knowledge_graph([text], st.session_state["GRAPH_FILENAME"])
103
- st.session_state['has_run'] = True
104
 
105
  def free_text_layout():
106
  st.text_input("Free text", key="free_text")
@@ -166,7 +166,7 @@ def show_wiki_hub_page():
166
  )
167
  print(st.session_state)
168
 
169
- if st.session_state['has_run']:
170
  HtmlFile = open(st.session_state["GRAPH_FILENAME"], 'r', encoding='utf-8')
171
  source_code = HtmlFile.read()
172
  components.html(source_code, width=720, height=600)
@@ -194,7 +194,7 @@ def show_free_text_hub_page():
194
  free_text_layout()
195
  print(st.session_state)
196
 
197
- if st.session_state['has_run']:
198
  print(st.session_state)
199
  HtmlFile = open(st.session_state["GRAPH_FILENAME"], 'r', encoding='utf-8')
200
  source_code = HtmlFile.read()
 
100
  st.session_state["GRAPH_FILENAME"] = str(dt.now().timestamp()*1000) + ".html"
101
  text = st.session_state['free_text'][0:500]
102
  rebel.generate_knowledge_graph([text], st.session_state["GRAPH_FILENAME"])
103
+ st.session_state['has_run_free'] = True
104
 
105
  def free_text_layout():
106
  st.text_input("Free text", key="free_text")
 
166
  )
167
  print(st.session_state)
168
 
169
+ if st.session_state['has_run_wiki']:
170
  HtmlFile = open(st.session_state["GRAPH_FILENAME"], 'r', encoding='utf-8')
171
  source_code = HtmlFile.read()
172
  components.html(source_code, width=720, height=600)
 
194
  free_text_layout()
195
  print(st.session_state)
196
 
197
+ if st.session_state['has_run_free']:
198
  print(st.session_state)
199
  HtmlFile = open(st.session_state["GRAPH_FILENAME"], 'r', encoding='utf-8')
200
  source_code = HtmlFile.read()