Lim0011 commited on
Commit
86d1688
·
verified ·
1 Parent(s): 54e6f37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -71,7 +71,7 @@ def load_example_and_set_index(paper_text_input):
71
 
72
  def extract_research_elements(paper_text):
73
  global state_extract, index_ex, state_example
74
- if not state_example:
75
  return "", "", "", ""
76
  state_extract = True
77
  example = example_data[index_ex]
@@ -83,8 +83,8 @@ def extract_research_elements(paper_text):
83
 
84
 
85
  # Step 2: Generate Research Hypothesis and Experiment Plan
86
- def generate_and_store(tasks, gaps, keywords, recent_works):
87
- if (not state_extract or not state_example):
88
  return "", "", "", ""
89
  global state_generate, index_ex
90
  state_generate = True
@@ -263,7 +263,7 @@ with gr.Blocks(theme=gr.themes.Default()) as app:
263
 
264
  generate_button.click(
265
  fn=generate_and_store,
266
- inputs=[tasks_output, gaps_output, keywords_output, recent_works_output],
267
  outputs=[hypothesis_output, experiment_plan_output, hypothesis_state, experiment_plan_state]
268
  )
269
 
 
71
 
72
  def extract_research_elements(paper_text):
73
  global state_extract, index_ex, state_example
74
+ if not state_example or paper_text == "":
75
  return "", "", "", ""
76
  state_extract = True
77
  example = example_data[index_ex]
 
83
 
84
 
85
  # Step 2: Generate Research Hypothesis and Experiment Plan
86
+ def generate_and_store(paper_text, tasks, gaps, keywords, recent_works):
87
+ if (not state_extract or not state_example or paper_text == ""):
88
  return "", "", "", ""
89
  global state_generate, index_ex
90
  state_generate = True
 
263
 
264
  generate_button.click(
265
  fn=generate_and_store,
266
+ inputs=[paper_text_input, tasks_output, gaps_output, keywords_output, recent_works_output],
267
  outputs=[hypothesis_output, experiment_plan_output, hypothesis_state, experiment_plan_state]
268
  )
269