zeyadusf commited on
Commit
4199002
1 Parent(s): 1c3ec05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -29,11 +29,11 @@ def gradio_interface(question, context, max_length, num_beams, early_stopping):
29
  return generate_text(question, context, max_length, num_beams, early_stopping)
30
 
31
  # Gradio UI Components
32
- question_input = gr.inputs.Textbox(label="Enter the Question", default="what is the total amount of players for the rockets in 1998 only?")
33
- context_input = gr.inputs.Textbox(label="Enter the Context", default="df = pd.DataFrame(columns=['player', 'years_for_rockets'])")
34
- max_length_input = gr.inputs.Slider(minimum=50, maximum=1024, default=512, label="Max Length")
35
- num_beams_input = gr.inputs.Slider(minimum=1, maximum=10, default=4, label="Number of Beams")
36
- early_stopping_input = gr.inputs.Checkbox(default=True, label="Early Stopping")
37
 
38
  # Custom CSS to style the slider, checkbox, and center the button
39
  custom_css = """
@@ -47,12 +47,10 @@ input[type="range"]::-webkit-slider-thumb {
47
  input[type="range"]::-webkit-slider-runnable-track {
48
  background-color: #32CD32; /* Light green slider track */
49
  }
50
-
51
  /* Make the checkbox light green */
52
  input[type="checkbox"] {
53
  accent-color: lightgreen;
54
  }
55
-
56
  /* Center the button */
57
  .gr-button.gr-button-primary {
58
  display: block;
 
29
  return generate_text(question, context, max_length, num_beams, early_stopping)
30
 
31
  # Gradio UI Components
32
+ question_input = gr.Textbox(label="Enter the Question", value="what is the total amount of players for the rockets in 1998 only?")
33
+ context_input = gr.Textbox(label="Enter the Context", value="df = pd.DataFrame(columns=['player', 'years_for_rockets'])")
34
+ max_length_input = gr.Slider(minimum=50, maximum=1024, value=512, label="Max Length")
35
+ num_beams_input = gr.Slider(minimum=1, maximum=10, value=4, label="Number of Beams")
36
+ early_stopping_input = gr.Checkbox(value=True, label="Early Stopping")
37
 
38
  # Custom CSS to style the slider, checkbox, and center the button
39
  custom_css = """
 
47
  input[type="range"]::-webkit-slider-runnable-track {
48
  background-color: #32CD32; /* Light green slider track */
49
  }
 
50
  /* Make the checkbox light green */
51
  input[type="checkbox"] {
52
  accent-color: lightgreen;
53
  }
 
54
  /* Center the button */
55
  .gr-button.gr-button-primary {
56
  display: block;