m7n commited on
Commit
7326ce2
·
1 Parent(s): 30a8176

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -313,10 +313,10 @@ intro_html = """
313
  <h1>On Rankings</h1>
314
  <p>One of the central experiences of being an academic is the experience of being ranked. We are ranked when we apply for graduate school, or maybe already for a master's degree. We are ranked when we're up for faculty positions. We are ranked when we submit abstracts for conferences. And when we publish papers, we do so, of course, in journals that are ranked. The places where we work, the departments, are ranked, of course, as well. But although rankings apparently are catnip to academics, and probably everybody else as well, we do have some agreement. Most people probably share the intuition that there's something weird or iffy about rankings, and the suspicion that maybe often they are not as informative as there are some beings absolutely everywhere who suggest.</p>
315
  """
316
- comment_distribution_image = """<p>This is the disrtribution from which our applicants will be sampled:</p>"""
317
 
318
  # Building the interface
319
- with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
320
  with gr.Column():
321
  gr.HTML(intro_html)
322
  with gr.Row():
@@ -324,14 +324,15 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
324
  run_button = gr.Button("Run Simulations!")
325
 
326
  # control applicant distribution
327
- with gr.Group():
328
- alpha_slider = gr.Slider(0.1, 5, step=0.1, value=1.4, label="Alpha (β Distribution)")
329
- beta_slider = gr.Slider(0.1, 5, step=0.1,value=2.7, label="Beta (β Distribution)")
330
  # simumlation-settings:
331
- num_applicants = gr.Slider(10, 300, step=10, value=100, label="Number of Applicants")
332
- num_judges = gr.Slider(1, 100, step=1, value=7, label="Number of Judges")
333
- ratings_per_applicant = gr.Slider(1, 5, step=1, value=3, label="Ratings per Applicant", info='how many different ratings each application gets.')
334
- top_n = gr.Slider(1, 40, step=1, value=5, label="Top N")
 
335
 
336
  judge_error = gr.Slider(0, 10, step=1, value=2, label="Judge Error")
337
  judgment_coarse_graining_true_false = gr.Checkbox(value= True, label="Coarse grain judgements.")
@@ -343,8 +344,8 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
343
 
344
  with gr.Column():
345
  with gr.Group():
 
346
  beta_plot = gr.Plot(label="Applicants quality distribution")
347
- gr.HTML(comment_distribution_image)
348
 
349
  # Your existing plot output
350
  plot_output = gr.Plot(label="Simulation Results",show_label=True)
@@ -354,7 +355,7 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
354
  run_button.click(
355
  run_simulation_and_plot,
356
  inputs=[num_runs, num_applicants, num_judges, ratings_per_applicant, top_n, alpha_slider, beta_slider, judge_error, judgment_coarse_graining,judgment_coarse_graining_true_false],
357
- outputs=[plot_output]
358
  )
359
 
360
  alpha_slider.change(plot_beta_distribution, inputs=[alpha_slider, beta_slider,judge_error], outputs=[beta_plot])
@@ -364,5 +365,4 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
364
  demo.load(plot_beta_distribution, inputs=[alpha_slider, beta_slider,judge_error], outputs=[beta_plot])
365
 
366
  if __name__ == "__main__":
367
- demo.launch(debug=True)
368
-
 
313
  <h1>On Rankings</h1>
314
  <p>One of the central experiences of being an academic is the experience of being ranked. We are ranked when we apply for graduate school, or maybe already for a master's degree. We are ranked when we're up for faculty positions. We are ranked when we submit abstracts for conferences. And when we publish papers, we do so, of course, in journals that are ranked. The places where we work, the departments, are ranked, of course, as well. But although rankings apparently are catnip to academics, and probably everybody else as well, we do have some agreement. Most people probably share the intuition that there's something weird or iffy about rankings, and the suspicion that maybe often they are not as informative as there are some beings absolutely everywhere who suggest.</p>
315
  """
316
+ comment_distribution_image = """<p>This is the distribution from which our applicants will be sampled:</p>"""
317
 
318
  # Building the interface
319
+ with gr.Blocks(theme=gr.themes.Monochrome(primary_hue="red", secondary_hue="pink",spacing_size="sm",text_size="lg", radius_size="none")) as demo:
320
  with gr.Column():
321
  gr.HTML(intro_html)
322
  with gr.Row():
 
324
  run_button = gr.Button("Run Simulations!")
325
 
326
  # control applicant distribution
327
+ # with gr.Group():
328
+ alpha_slider = gr.Slider(0.1, 5, step=0.1, value=1.4, label="Alpha (β Distribution)")
329
+ beta_slider = gr.Slider(0.1, 5, step=0.1,value=2.7, label="Beta (β Distribution)")
330
  # simumlation-settings:
331
+ with gr.Group():
332
+ num_applicants = gr.Slider(10, 300, step=10, value=100, label="Number of Applicants")
333
+ num_judges = gr.Slider(1, 100, step=1, value=7, label="Number of Judges")
334
+ ratings_per_applicant = gr.Slider(1, 5, step=1, value=3, label="Ratings per Applicant", info='how many different ratings each application gets.')
335
+ top_n = gr.Slider(1, 40, step=1, value=5, label="Top N")
336
 
337
  judge_error = gr.Slider(0, 10, step=1, value=2, label="Judge Error")
338
  judgment_coarse_graining_true_false = gr.Checkbox(value= True, label="Coarse grain judgements.")
 
344
 
345
  with gr.Column():
346
  with gr.Group():
347
+ # gr.HTML(comment_distribution_image)
348
  beta_plot = gr.Plot(label="Applicants quality distribution")
 
349
 
350
  # Your existing plot output
351
  plot_output = gr.Plot(label="Simulation Results",show_label=True)
 
355
  run_button.click(
356
  run_simulation_and_plot,
357
  inputs=[num_runs, num_applicants, num_judges, ratings_per_applicant, top_n, alpha_slider, beta_slider, judge_error, judgment_coarse_graining,judgment_coarse_graining_true_false],
358
+ outputs=[plot_output], scroll_to_output = True
359
  )
360
 
361
  alpha_slider.change(plot_beta_distribution, inputs=[alpha_slider, beta_slider,judge_error], outputs=[beta_plot])
 
365
  demo.load(plot_beta_distribution, inputs=[alpha_slider, beta_slider,judge_error], outputs=[beta_plot])
366
 
367
  if __name__ == "__main__":
368
+ demo.launch(debug=True)