Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
33 |
-
context_input = gr.
|
34 |
-
max_length_input = gr.
|
35 |
-
num_beams_input = gr.
|
36 |
-
early_stopping_input = gr.
|
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;
|