Spaces:
Running
Running
Sadjad Alikhani
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -28,23 +28,33 @@ def display_images(percentage_idx, complexity_idx):
|
|
28 |
return raw_image, embeddings_image
|
29 |
|
30 |
# Define the Gradio interface
|
31 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
gr.Markdown("# Raw vs. Embeddings Inference Results")
|
33 |
gr.Markdown("Use the sliders to adjust the percentage of data for training and task complexity.")
|
34 |
|
35 |
-
# Layout for vertical side-by-side sliders
|
36 |
with gr.Row():
|
37 |
# Column for percentage slider
|
38 |
-
with gr.Column():
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
# Column for complexity slider
|
44 |
-
with gr.Column():
|
45 |
-
|
46 |
-
|
47 |
-
interactive=True, orientation="vertical")
|
48 |
|
49 |
# Outputs (display the images side by side and set a smaller size for the images)
|
50 |
with gr.Row():
|
|
|
28 |
return raw_image, embeddings_image
|
29 |
|
30 |
# Define the Gradio interface
|
31 |
+
with gr.Blocks(css="""
|
32 |
+
.vertical-slider input[type=range] {
|
33 |
+
writing-mode: bt-lr; /* IE */
|
34 |
+
-webkit-appearance: slider-vertical; /* WebKit */
|
35 |
+
width: 8px;
|
36 |
+
height: 200px;
|
37 |
+
}
|
38 |
+
.slider-container {
|
39 |
+
display: inline-block;
|
40 |
+
margin-right: 50px;
|
41 |
+
text-align: center;
|
42 |
+
}
|
43 |
+
""") as demo:
|
44 |
gr.Markdown("# Raw vs. Embeddings Inference Results")
|
45 |
gr.Markdown("Use the sliders to adjust the percentage of data for training and task complexity.")
|
46 |
|
47 |
+
# Layout for vertical side-by-side sliders (using CSS to rotate sliders)
|
48 |
with gr.Row():
|
49 |
# Column for percentage slider
|
50 |
+
with gr.Column(elem_id="slider-container"):
|
51 |
+
gr.Markdown("Percentage of Data for Training")
|
52 |
+
percentage_slider = gr.Slider(minimum=0, maximum=4, step=1, value=0, interactive=True, elem_id="vertical-slider")
|
53 |
+
|
|
|
54 |
# Column for complexity slider
|
55 |
+
with gr.Column(elem_id="slider-container"):
|
56 |
+
gr.Markdown("Task Complexity")
|
57 |
+
complexity_slider = gr.Slider(minimum=0, maximum=1, step=1, value=0, interactive=True, elem_id="vertical-slider")
|
|
|
58 |
|
59 |
# Outputs (display the images side by side and set a smaller size for the images)
|
60 |
with gr.Row():
|