Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dawoodkhan82 committed Sep 26, 2022
1 parent 898866c commit 6deb1f7
Show file tree
Hide file tree
Showing 10 changed files with 403 additions and 242 deletions.
36 changes: 27 additions & 9 deletions demo/blocks_inputs/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.1.4",
"version": "3.3\n",
"mode": "blocks",
"dev_mode": true,
"components": [
Expand Down Expand Up @@ -72,6 +72,7 @@
"image_mode": "RGB",
"source": "upload",
"tool": "editor",
"value": null,
"streaming": false,
"mirror_webcam": true,
"show_label": true,
Expand All @@ -87,6 +88,7 @@
"image_mode": "RGB",
"source": "upload",
"tool": "editor",
"value": null,
"streaming": false,
"mirror_webcam": true,
"show_label": true,
Expand Down Expand Up @@ -172,23 +174,39 @@
"visible": true,
"style": {}
}
},
{
"id": 13,
"type": "form",
"props": {
"type": "form",
"visible": true,
"style": {}
}
}
],
"theme": "default",
"css": null,
"title": "Gradio",
"enable_queue": false,
"is_space": false,
"enable_queue": null,
"show_error": false,
"layout": {
"id": 0,
"children": [
{
"id": 1
},
{
"id": 2
},
{
"id": 3
"id": 13,
"children": [
{
"id": 1
},
{
"id": 2
},
{
"id": 3
}
]
},
{
"id": 4
Expand Down
51 changes: 34 additions & 17 deletions demo/blocks_kinematics/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.1.4",
"version": "3.3\n",
"mode": "blocks",
"dev_mode": true,
"components": [
Expand Down Expand Up @@ -27,9 +27,9 @@
"type": "slider",
"props": {
"minimum": 1,
"maximum": 30,
"step": 0.1,
"value": 25,
"maximum": 30000,
"step": 5,
"value": 25000,
"label": "Speed",
"show_label": true,
"name": "slider",
Expand All @@ -42,9 +42,9 @@
"type": "slider",
"props": {
"minimum": 0,
"maximum": 90,
"step": 0.1,
"value": 45,
"maximum": 900,
"step": 100,
"value": 45000,
"label": "Angle",
"show_label": true,
"name": "slider",
Expand All @@ -54,16 +54,26 @@
},
{
"id": 5,
"type": "form",
"props": {
"type": "form",
"visible": true,
"style": {}
}
},
{
"id": 6,
"type": "plot",
"props": {
"value": null,
"show_label": true,
"name": "plot",
"visible": true,
"style": {}
}
},
{
"id": 6,
"id": 7,
"type": "button",
"props": {
"value": "Run",
Expand All @@ -77,7 +87,9 @@
"theme": "default",
"css": null,
"title": "Gradio",
"enable_queue": false,
"is_space": false,
"enable_queue": null,
"show_error": false,
"layout": {
"id": 0,
"children": [
Expand All @@ -88,33 +100,38 @@
"id": 2,
"children": [
{
"id": 3
},
{
"id": 4
"id": 5,
"children": [
{
"id": 3
},
{
"id": 4
}
]
}
]
},
{
"id": 5
"id": 6
},
{
"id": 6
"id": 7
}
]
},
"dependencies": [
{
"targets": [
6
7
],
"trigger": "click",
"inputs": [
3,
4
],
"outputs": [
5
6
],
"backend_fn": true,
"js": null,
Expand Down
4 changes: 2 additions & 2 deletions demo/blocks_kinematics/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def plot(v, a):
)

with gr.Row():
speed = gr.Slider(1, 30, 25, label="Speed")
angle = gr.Slider(0, 90, 45, label="Angle")
speed = gr.Slider(1, 30000, 25000, step=5, label="Speed")
angle = gr.Slider(0, 900, 45000, step=100, label="Angle")
output = gr.Plot()
btn = gr.Button(value="Run")
btn.click(plot, [speed, angle], output)
Expand Down
30 changes: 23 additions & 7 deletions demo/blocks_page_load/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.1.4",
"version": "3.3\n",
"mode": "blocks",
"dev_mode": true,
"components": [
Expand Down Expand Up @@ -30,20 +30,36 @@
"visible": true,
"style": {}
}
},
{
"id": 3,
"type": "form",
"props": {
"type": "form",
"visible": true,
"style": {}
}
}
],
"theme": "default",
"css": null,
"title": "Gradio",
"enable_queue": false,
"is_space": false,
"enable_queue": null,
"show_error": false,
"layout": {
"id": 0,
"children": [
{
"id": 1
},
{
"id": 2
"id": 3,
"children": [
{
"id": 1
},
{
"id": 2
}
]
}
]
},
Expand All @@ -58,7 +74,7 @@
2
],
"backend_fn": true,
"js": false,
"js": null,
"status_tracker": null,
"queue": null,
"api_name": null,
Expand Down
Loading

0 comments on commit 6deb1f7

Please sign in to comment.