anujjuna commited on
Commit
e100b63
Β·
verified Β·
1 Parent(s): fdaeca3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -15
app.py CHANGED
@@ -97,9 +97,8 @@ def _run(file, gk, mk, gek, n_trials, progress=gr.Progress(track_tqdm=True)):
97
  sp = r.get("sheet_paths",{})
98
  mdf = pd.DataFrame(r.get("mismatch_table",[]))
99
  progress(1.0, desc="βœ… Done!")
100
- return (summary, fig, pfig, tl_show, cdf, s1, s2, s3, s4,
101
- sp.get(1), sp.get(2), sp.get(3), sp.get(4),
102
- r.get("json_path"), mdf)
103
 
104
  # ── UI ───────────────────────────────────────────────────────────────────────
105
  css = ".gradio-container{background:#0d1117!important;color:#c9d1d9!important}" \
@@ -126,23 +125,19 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue="blue",neutral_hue="slate"),
126
  with gr.Tab("Pareto Front"): pareto_out = gr.Plot()
127
  with gr.Tab("Trial Log"): trial_out = gr.Dataframe()
128
  with gr.Tab("Clusters"): cluster_out = gr.Dataframe()
129
- with gr.Tab("Sheet 1 β€” Groq"):
130
- s1_out = gr.Dataframe(); s1_dl = gr.File(label="⬇ Download")
131
- with gr.Tab("Sheet 2 β€” Mistral"):
132
- s2_out = gr.Dataframe(); s2_dl = gr.File(label="⬇ Download")
133
- with gr.Tab("Sheet 3 β€” Gemini"):
134
- s3_out = gr.Dataframe(); s3_dl = gr.File(label="⬇ Download")
135
- with gr.Tab("Sheet 4 β€” Consolidated"):
136
- s4_out = gr.Dataframe(); s4_dl = gr.File(label="⬇ Download")
137
- with gr.Tab("Downloads"):
138
- json_dl = gr.File(label="topics.json")
139
  with gr.Tab("RQ Mismatch"): mismatch_out = gr.Dataframe()
 
 
 
140
  file_in.change(_preview, inputs=[file_in], outputs=[preview_out])
141
  run_btn.click(_run,
142
  inputs=[file_in, groq_in, mistral_in, gemini_in, trials_in],
143
  outputs=[summary_out, scatter_out, pareto_out, trial_out, cluster_out,
144
- s1_out, s2_out, s3_out, s4_out,
145
- s1_dl, s2_dl, s3_dl, s4_dl, json_dl, mismatch_out])
146
 
147
  if __name__ == "__main__":
148
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
97
  sp = r.get("sheet_paths",{})
98
  mdf = pd.DataFrame(r.get("mismatch_table",[]))
99
  progress(1.0, desc="βœ… Done!")
100
+ dl_files = [sp.get(i) for i in [1,2,3,4]] + [r.get("json_path")]
101
+ return (summary, fig, pfig, tl_show, cdf, s1, s2, s3, s4, dl_files, mdf)
 
102
 
103
  # ── UI ───────────────────────────────────────────────────────────────────────
104
  css = ".gradio-container{background:#0d1117!important;color:#c9d1d9!important}" \
 
125
  with gr.Tab("Pareto Front"): pareto_out = gr.Plot()
126
  with gr.Tab("Trial Log"): trial_out = gr.Dataframe()
127
  with gr.Tab("Clusters"): cluster_out = gr.Dataframe()
128
+ with gr.Tab("Sheet 1 β€” Groq"): s1_out = gr.Dataframe()
129
+ with gr.Tab("Sheet 2 β€” Mistral"): s2_out = gr.Dataframe()
130
+ with gr.Tab("Sheet 3 β€” Gemini"): s3_out = gr.Dataframe()
131
+ with gr.Tab("Sheet 4 β€” Consolidated"): s4_out = gr.Dataframe()
 
 
 
 
 
 
132
  with gr.Tab("RQ Mismatch"): mismatch_out = gr.Dataframe()
133
+ with gr.Tab("Downloads"):
134
+ dl_out = gr.File(label="All sheet CSVs + topics.json",
135
+ file_count="multiple")
136
  file_in.change(_preview, inputs=[file_in], outputs=[preview_out])
137
  run_btn.click(_run,
138
  inputs=[file_in, groq_in, mistral_in, gemini_in, trials_in],
139
  outputs=[summary_out, scatter_out, pareto_out, trial_out, cluster_out,
140
+ s1_out, s2_out, s3_out, s4_out, dl_out, mismatch_out])
 
141
 
142
  if __name__ == "__main__":
143
  demo.launch(server_name="0.0.0.0", server_port=7860)