Ryan commited on
Commit
7688cbd
·
1 Parent(s): 4b86743
Files changed (1) hide show
  1. app.py +16 -8
app.py CHANGED
@@ -72,6 +72,17 @@ def create_app():
72
  # Add a state for storing user dataset analysis results
73
  user_analysis_log = gr.State({})
74
 
 
 
 
 
 
 
 
 
 
 
 
75
  # Dataset Input Tab
76
  with gr.Tab("Dataset Input"):
77
  # Filter out files that start with 'summary' for the Dataset Input tab
@@ -92,7 +103,7 @@ def create_app():
92
  # Save dataset to state and update status
93
  def create_dataset(p, r1, m1, r2, m2):
94
  if not p or not r1 or not r2:
95
- return {}, "❌ **Error:** Please fill in at least the prompt and both responses"
96
 
97
  dataset = {
98
  "entries": [
@@ -968,7 +979,7 @@ def create_app():
968
  )
969
 
970
  load_summary_btn = gr.Button("Load Summary", variant="primary")
971
-
972
  summary_assistant_prompt = gr.Textbox(
973
  value="Attached are the results from various NLP based comparisons between two LLM responses on the same prompt. Give your interpretation of the results.",
974
  label="Analysis Assistant Prompt",
@@ -977,12 +988,9 @@ def create_app():
977
  )
978
 
979
  with gr.Column(scale=3):
980
- summary_content = gr.Textbox(
981
- label="Summary Content",
982
- lines=25,
983
- max_lines=50,
984
- interactive=False
985
- )
986
 
987
  summary_status = gr.Markdown("*No summary loaded*")
988
 
 
72
  # Add a state for storing user dataset analysis results
73
  user_analysis_log = gr.State({})
74
 
75
+ # Create the summary components at the top level so they can be referenced by all tabs
76
+ summary_content = gr.Textbox(
77
+ label="Summary Content",
78
+ lines=25,
79
+ max_lines=50,
80
+ interactive=False,
81
+ visible=False # Initially hidden
82
+ )
83
+
84
+ summary_status = gr.Markdown("", visible=False) # Initially hidden
85
+
86
  # Dataset Input Tab
87
  with gr.Tab("Dataset Input"):
88
  # Filter out files that start with 'summary' for the Dataset Input tab
 
103
  # Save dataset to state and update status
104
  def create_dataset(p, r1, m1, r2, m2):
105
  if not p or not r1 or not r2:
106
+ return {}, "❌ **Error:** Please fill in at least the prompt and both responses", "", "**Error:** Please fill all required fields"
107
 
108
  dataset = {
109
  "entries": [
 
979
  )
980
 
981
  load_summary_btn = gr.Button("Load Summary", variant="primary")
982
+
983
  summary_assistant_prompt = gr.Textbox(
984
  value="Attached are the results from various NLP based comparisons between two LLM responses on the same prompt. Give your interpretation of the results.",
985
  label="Analysis Assistant Prompt",
 
988
  )
989
 
990
  with gr.Column(scale=3):
991
+ # Make the previously hidden summary components visible in this tab
992
+ summary_content.visible = True
993
+ summary_status.visible = True
 
 
 
994
 
995
  summary_status = gr.Markdown("*No summary loaded*")
996