Spaces:
Running
Running
Update demo.py
Browse files
demo.py
CHANGED
@@ -52,6 +52,7 @@ css = """
|
|
52 |
width: 250px; /* Set all elements to the same width */
|
53 |
margin: 5px;
|
54 |
}
|
|
|
55 |
/* Adjusting layout for Input Text and Inference Result */
|
56 |
.input-row {
|
57 |
display: flex;
|
@@ -66,8 +67,11 @@ css = """
|
|
66 |
.output-text {
|
67 |
flex: 1; /* 1 part of the row */
|
68 |
}
|
|
|
|
|
69 |
.gradio-row button {
|
70 |
-
width:
|
|
|
71 |
}
|
72 |
"""
|
73 |
|
@@ -90,7 +94,7 @@ with gr.Blocks(css=css) as app:
|
|
90 |
label="Input Text",
|
91 |
placeholder="Enter Text Here",
|
92 |
lines=8,
|
93 |
-
elem_classes=["input-text"],
|
94 |
)
|
95 |
output = gr.Textbox(
|
96 |
label="Inference Result",
|
@@ -111,7 +115,6 @@ with gr.Blocks(css=css) as app:
|
|
111 |
submit_button = gr.Button("Run Detection", variant="primary")
|
112 |
clear_button = gr.Button("Clear", variant="secondary")
|
113 |
|
114 |
-
# Hooking up the change_mode function to select different models
|
115 |
submit_button.click(run_test_power, inputs=[model_name, input_text, input_text], outputs=output)
|
116 |
clear_button.click(lambda: ("", ""), inputs=[], outputs=[input_text, output])
|
117 |
|
@@ -133,4 +136,4 @@ with gr.Blocks(css=css) as app:
|
|
133 |
```
|
134 |
""")
|
135 |
|
136 |
-
app.launch()
|
|
|
52 |
width: 250px; /* Set all elements to the same width */
|
53 |
margin: 5px;
|
54 |
}
|
55 |
+
|
56 |
/* Adjusting layout for Input Text and Inference Result */
|
57 |
.input-row {
|
58 |
display: flex;
|
|
|
67 |
.output-text {
|
68 |
flex: 1; /* 1 part of the row */
|
69 |
}
|
70 |
+
|
71 |
+
/* Set button widths to match the Select Model width */
|
72 |
.gradio-row button {
|
73 |
+
width: 250px; /* Same as the select box width */
|
74 |
+
margin: 5px;
|
75 |
}
|
76 |
"""
|
77 |
|
|
|
94 |
label="Input Text",
|
95 |
placeholder="Enter Text Here",
|
96 |
lines=8,
|
97 |
+
elem_classes=["input-text"], # Applying the CSS class
|
98 |
)
|
99 |
output = gr.Textbox(
|
100 |
label="Inference Result",
|
|
|
115 |
submit_button = gr.Button("Run Detection", variant="primary")
|
116 |
clear_button = gr.Button("Clear", variant="secondary")
|
117 |
|
|
|
118 |
submit_button.click(run_test_power, inputs=[model_name, input_text, input_text], outputs=output)
|
119 |
clear_button.click(lambda: ("", ""), inputs=[], outputs=[input_text, output])
|
120 |
|
|
|
136 |
```
|
137 |
""")
|
138 |
|
139 |
+
app.launch()
|