Update app.py
Browse files
app.py
CHANGED
@@ -188,7 +188,7 @@ def gradio_interface():
|
|
188 |
""")
|
189 |
|
190 |
# Main Interface
|
191 |
-
|
192 |
with gr.TabItem("π― Experiment", id=0):
|
193 |
with gr.Row():
|
194 |
with gr.Column(scale=1):
|
@@ -265,24 +265,24 @@ def gradio_interface():
|
|
265 |
0.9, 0.8, 500, 300, "The end", None, False]
|
266 |
]
|
267 |
|
268 |
-
gr.
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
|
287 |
submit_btn = gr.Button(
|
288 |
"π Run Analysis",
|
@@ -399,42 +399,32 @@ def gradio_interface():
|
|
399 |
# Custom CSS
|
400 |
gr.HTML("""
|
401 |
<style>
|
402 |
-
.
|
403 |
-
border: 1px solid #E5E7EB !important;
|
404 |
-
border-radius: 8px !important;
|
405 |
-
padding: 12px !important;
|
406 |
-
}
|
407 |
-
.output-style {
|
408 |
-
background-color: #F9FAFB !important;
|
409 |
-
border-radius: 8px !important;
|
410 |
-
padding: 12px !important;
|
411 |
-
}
|
412 |
-
.table-style {
|
413 |
-
border-collapse: collapse !important;
|
414 |
-
width: 100% !important;
|
415 |
-
}
|
416 |
-
.table-style th {
|
417 |
-
background-color: #F3F4F6 !important;
|
418 |
-
padding: 12px !important;
|
419 |
-
}
|
420 |
-
.examples-style {
|
421 |
margin: 20px 0;
|
422 |
padding: 15px;
|
423 |
border: 1px solid #E5E7EB;
|
424 |
border-radius: 8px;
|
425 |
background-color: white;
|
426 |
}
|
427 |
-
.examples-
|
|
|
|
|
|
|
|
|
|
|
428 |
border: 1px solid #E5E7EB;
|
429 |
border-radius: 6px;
|
430 |
-
padding: 12px;
|
431 |
-
margin-bottom: 10px;
|
432 |
transition: all 0.2s;
|
433 |
}
|
434 |
-
.examples-
|
|
|
435 |
border-color: #4F46E5;
|
436 |
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
437 |
}
|
|
|
|
|
|
|
|
|
438 |
</style>
|
439 |
""")
|
440 |
|
|
|
188 |
""")
|
189 |
|
190 |
# Main Interface
|
191 |
+
with gr.Tabs() as tabs:
|
192 |
with gr.TabItem("π― Experiment", id=0):
|
193 |
with gr.Row():
|
194 |
with gr.Column(scale=1):
|
|
|
265 |
0.9, 0.8, 500, 300, "The end", None, False]
|
266 |
]
|
267 |
|
268 |
+
with gr.Box(elem_classes="examples-container"):
|
269 |
+
gr.Examples(
|
270 |
+
examples=examples,
|
271 |
+
inputs=[
|
272 |
+
task, system_prompt, input_text,
|
273 |
+
temperature, top_p, max_tokens,
|
274 |
+
min_tokens, stop, random_seed,
|
275 |
+
safe_prompt
|
276 |
+
],
|
277 |
+
outputs=[
|
278 |
+
omn_response, ml_response,
|
279 |
+
large_sentiment, open_sentiment,
|
280 |
+
large_keywords, open_keywords,
|
281 |
+
large_readability, open_readability
|
282 |
+
],
|
283 |
+
fn=run_inference_and_analysis,
|
284 |
+
cache_examples=True
|
285 |
+
)
|
286 |
|
287 |
submit_btn = gr.Button(
|
288 |
"π Run Analysis",
|
|
|
399 |
# Custom CSS
|
400 |
gr.HTML("""
|
401 |
<style>
|
402 |
+
.examples-container {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
403 |
margin: 20px 0;
|
404 |
padding: 15px;
|
405 |
border: 1px solid #E5E7EB;
|
406 |
border-radius: 8px;
|
407 |
background-color: white;
|
408 |
}
|
409 |
+
.examples-container .gr-samples-table {
|
410 |
+
border-collapse: separate;
|
411 |
+
border-spacing: 0 8px;
|
412 |
+
}
|
413 |
+
.examples-container .gr-samples-table tr {
|
414 |
+
background-color: #F9FAFB;
|
415 |
border: 1px solid #E5E7EB;
|
416 |
border-radius: 6px;
|
|
|
|
|
417 |
transition: all 0.2s;
|
418 |
}
|
419 |
+
.examples-container .gr-samples-table tr:hover {
|
420 |
+
background-color: #F3F4F6;
|
421 |
border-color: #4F46E5;
|
422 |
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
423 |
}
|
424 |
+
.examples-container .gr-samples-table td {
|
425 |
+
padding: 12px;
|
426 |
+
border: none;
|
427 |
+
}
|
428 |
</style>
|
429 |
""")
|
430 |
|