-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Blocks Tests #902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Blocks Tests #902
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
dcc9ba8
blocks-tests
omerXfaruq acda997
blocks-tests
omerXfaruq c0c46c2
blocks-tests
omerXfaruq aa01ab8
Merge branch 'blocks-dev' into blocks-tests
abidlabs 2d30bfd
blocks-tests
omerXfaruq 839dcd6
Merge branch 'blocks-tests' of https://github.com/gradio-app/gradio i…
omerXfaruq 2825ee6
resolving relative imports
abidlabs ac4568d
Merge branch 'blocks-tests' of github.com:gradio-app/gradio into bloc…
abidlabs 2ec8482
fixed config
abidlabs 9d7de51
fixed config
abidlabs 117776e
added init
abidlabs 16ca460
blocks-tests
omerXfaruq 88c79ef
Merge branch 'blocks-tests' of https://github.com/gradio-app/gradio i…
omerXfaruq e09df09
fixed formatting
abidlabs b851831
hacky way to get imports to work
abidlabs 8daada1
slightly better
abidlabs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,149 +1,220 @@ | ||
| XRAY_CONFIG = { | ||
| "mode": "blocks", | ||
| "components": [ | ||
| { | ||
| "id": 1, | ||
| "type": "markdown", | ||
| "props": { | ||
| "default_value": "<pre><code># Detect Disease From Scan\nWith this model you can lorem ipsum\n- ipsum 1\n- ipsum 2\n</code></pre>\n", | ||
| "name": "markdown", | ||
| "label": None, | ||
| "css": {}, | ||
| }, | ||
| }, | ||
| { | ||
| "id": 2, | ||
| "type": "checkboxgroup", | ||
| "props": { | ||
| "choices": ["Covid", "Malaria", "Lung Cancer"], | ||
| "default_value": [], | ||
| "name": "checkboxgroup", | ||
| "label": "Disease to Scan For", | ||
| "css": {}, | ||
| }, | ||
| }, | ||
| {"id": 3, "type": "tabs", "props": {"css": {}}}, | ||
| {"id": 4, "type": "tabitem", "props": {"label": "X-ray", "css": {}}}, | ||
| {"id": 5, "type": "tabitem", "props": {"label": "X-ray", "css": {}}}, | ||
| {"id": 6, "type": "row", "props": {"type": "row", "css": {}}}, | ||
| { | ||
| "id": 7, | ||
| "type": "image", | ||
| "props": { | ||
| "image_mode": "RGB", | ||
| "shape": None, | ||
| "source": "upload", | ||
| "tool": "editor", | ||
| "default_value": None, | ||
| "name": "image", | ||
| "label": None, | ||
| "css": {}, | ||
| }, | ||
| }, | ||
| { | ||
| "id": 8, | ||
| "type": "json", | ||
| "props": {"default_value": '""', "name": "json", "label": None, "css": {}}, | ||
| }, | ||
| { | ||
| "id": 9, | ||
| "type": "button", | ||
| "props": { | ||
| "default_value": "Run", | ||
| "name": "button", | ||
| "label": None, | ||
| "css": {"background-color": "red", "--hover-color": "orange"}, | ||
| }, | ||
| }, | ||
| {"id": 10, "type": "tabitem", "props": {"label": "CT Scan", "css": {}}}, | ||
| {"id": 11, "type": "tabitem", "props": {"label": "CT Scan", "css": {}}}, | ||
| {"id": 12, "type": "row", "props": {"type": "row", "css": {}}}, | ||
| { | ||
| "id": 13, | ||
| "type": "image", | ||
| "props": { | ||
| "image_mode": "RGB", | ||
| "shape": None, | ||
| "source": "upload", | ||
| "tool": "editor", | ||
| "default_value": None, | ||
| "name": "image", | ||
| "label": None, | ||
| "css": {}, | ||
| }, | ||
| }, | ||
| { | ||
| "id": 14, | ||
| "type": "json", | ||
| "props": {"default_value": '""', "name": "json", "label": None, "css": {}}, | ||
| }, | ||
| { | ||
| "id": 15, | ||
| "type": "button", | ||
| "props": { | ||
| "default_value": "Run", | ||
| "name": "button", | ||
| "label": None, | ||
| "css": {}, | ||
| }, | ||
| }, | ||
| { | ||
| "id": 16, | ||
| "type": "textbox", | ||
| "props": { | ||
| "lines": 1, | ||
| "placeholder": None, | ||
| "default_value": "", | ||
| "name": "textbox", | ||
| "label": None, | ||
| "css": {}, | ||
| }, | ||
| }, | ||
| ], | ||
| "theme": "default", | ||
| "layout": { | ||
| "id": 0, | ||
| "children": [ | ||
| {"id": 1}, | ||
| {"id": 2}, | ||
| { | ||
| "id": 3, | ||
| "children": [ | ||
| { | ||
| "id": 5, | ||
| "children": [ | ||
| {"id": 6, "children": [{"id": 7}, {"id": 8}]}, | ||
| {"id": 9}, | ||
| ], | ||
| }, | ||
| { | ||
| "id": 5, | ||
| "children": [ | ||
| {"id": 6, "children": [{"id": 7}, {"id": 8}]}, | ||
| {"id": 9}, | ||
| ], | ||
| }, | ||
| { | ||
| "id": 11, | ||
| "children": [ | ||
| {"id": 12, "children": [{"id": 13}, {"id": 14}]}, | ||
| {"id": 15}, | ||
| ], | ||
| }, | ||
| { | ||
| "id": 11, | ||
| "children": [ | ||
| {"id": 12, "children": [{"id": 13}, {"id": 14}]}, | ||
| {"id": 15}, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| {"id": 16}, | ||
| ], | ||
| }, | ||
| "dependencies": [ | ||
| {"targets": [9], "trigger": "click", "inputs": [2, 7], "outputs": [8]}, | ||
| {"targets": [15], "trigger": "click", "inputs": [2, 13], "outputs": [14]}, | ||
| ], | ||
| } | ||
| 'mode': 'blocks', | ||
| 'components': [{ | ||
| 'id': 1, | ||
| 'type': 'markdown', | ||
| 'props': { | ||
| 'default_value': '<pre><code> # Detect Disease From Scan\n With this model you can lorem ipsum\n - ipsum 1\n - ipsum 2\n</code></pre>\n', | ||
| 'name': 'markdown', | ||
| 'label': None, | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 2, | ||
| 'type': 'checkboxgroup', | ||
| 'props': { | ||
| 'choices': ['Covid', 'Malaria', 'Lung Cancer'], | ||
| 'default_value': [], | ||
| 'name': 'checkboxgroup', | ||
| 'label': 'Disease to Scan For', | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 3, | ||
| 'type': 'tabs', | ||
| 'props': { | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 4, | ||
| 'type': 'tabitem', | ||
| 'props': { | ||
| 'label': 'X-ray', | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 5, | ||
| 'type': 'tabitem', | ||
| 'props': { | ||
| 'label': 'X-ray', | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 6, | ||
| 'type': 'row', | ||
| 'props': { | ||
| 'type': 'row', | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 7, | ||
| 'type': 'image', | ||
| 'props': { | ||
| 'image_mode': 'RGB', | ||
| 'shape': None, | ||
| 'source': 'upload', | ||
| 'tool': 'editor', | ||
| 'default_value': None, | ||
| 'name': 'image', | ||
| 'label': None, | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 8, | ||
| 'type': 'json', | ||
| 'props': { | ||
| 'default_value': '""', | ||
| 'name': 'json', | ||
| 'label': None, | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 9, | ||
| 'type': 'button', | ||
| 'props': { | ||
| 'default_value': 'Run', | ||
| 'name': 'button', | ||
| 'label': None, | ||
| 'css': { | ||
| 'background-color': 'red', | ||
| '--hover-color': 'orange' | ||
| } | ||
| } | ||
| }, { | ||
| 'id': 10, | ||
| 'type': 'tabitem', | ||
| 'props': { | ||
| 'label': 'CT Scan', | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 11, | ||
| 'type': 'tabitem', | ||
| 'props': { | ||
| 'label': 'CT Scan', | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 12, | ||
| 'type': 'row', | ||
| 'props': { | ||
| 'type': 'row', | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 13, | ||
| 'type': 'image', | ||
| 'props': { | ||
| 'image_mode': 'RGB', | ||
| 'shape': None, | ||
| 'source': 'upload', | ||
| 'tool': 'editor', | ||
| 'default_value': None, | ||
| 'name': 'image', | ||
| 'label': None, | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 14, | ||
| 'type': 'json', | ||
| 'props': { | ||
| 'default_value': '""', | ||
| 'name': 'json', | ||
| 'label': None, | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 15, | ||
| 'type': 'button', | ||
| 'props': { | ||
| 'default_value': 'Run', | ||
| 'name': 'button', | ||
| 'label': None, | ||
| 'css': {} | ||
| } | ||
| }, { | ||
| 'id': 16, | ||
| 'type': 'textbox', | ||
| 'props': { | ||
| 'lines': 1, | ||
| 'placeholder': None, | ||
| 'default_value': '', | ||
| 'name': 'textbox', | ||
| 'label': None, | ||
| 'css': {} | ||
| } | ||
| }], | ||
| 'theme': 'default', | ||
| 'layout': { | ||
| 'id': 0, | ||
| 'children': [{ | ||
| 'id': 1 | ||
| }, { | ||
| 'id': 2 | ||
| }, { | ||
| 'id': 3, | ||
| 'children': [{ | ||
| 'id': 5, | ||
| 'children': [{ | ||
| 'id': 6, | ||
| 'children': [{ | ||
| 'id': 7 | ||
| }, { | ||
| 'id': 8 | ||
| }] | ||
| }, { | ||
| 'id': 9 | ||
| }] | ||
| }, { | ||
| 'id': 5, | ||
| 'children': [{ | ||
| 'id': 6, | ||
| 'children': [{ | ||
| 'id': 7 | ||
| }, { | ||
| 'id': 8 | ||
| }] | ||
| }, { | ||
| 'id': 9 | ||
| }] | ||
| }, { | ||
| 'id': 11, | ||
| 'children': [{ | ||
| 'id': 12, | ||
| 'children': [{ | ||
| 'id': 13 | ||
| }, { | ||
| 'id': 14 | ||
| }] | ||
| }, { | ||
| 'id': 15 | ||
| }] | ||
| }, { | ||
| 'id': 11, | ||
| 'children': [{ | ||
| 'id': 12, | ||
| 'children': [{ | ||
| 'id': 13 | ||
| }, { | ||
| 'id': 14 | ||
| }] | ||
| }, { | ||
| 'id': 15 | ||
| }] | ||
| }] | ||
| }, { | ||
| 'id': 16 | ||
| }] | ||
| }, | ||
| 'dependencies': [{ | ||
| 'targets': [9], | ||
| 'trigger': 'click', | ||
| 'inputs': [2, 7], | ||
| 'outputs': [8] | ||
| }, { | ||
| 'targets': [15], | ||
| 'trigger': 'click', | ||
| 'inputs': [2, 13], | ||
| 'outputs': [14] | ||
| }] | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the config from from terminal with
print(xray_blocks.get_config_file()), not sure why it does not comply with the test.Thanks for the fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same lol