mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
9b42ba8f10
* changes * changes * revert changes * changes * add changeset * notebooks script * changes * changes --------- Co-authored-by: Ali Abid <aliabid94@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Ali Abdalla <ali.si3luwa@gmail.com>
25 lines
625 B
Python
25 lines
625 B
Python
import gradio as gr
|
|
import numpy as np
|
|
|
|
with gr.Blocks() as demo:
|
|
inp = gr.JSON(
|
|
label="InputJSON",
|
|
value={
|
|
"Key 1": "Value 1",
|
|
"Key 2": {"Key 3": "Value 2", "Key 4": "Value 3"},
|
|
"Key 5": ["Item 1", "Item 2", "Item 3"],
|
|
"Key 6": 123,
|
|
"Key 7": 123.456,
|
|
"Key 8": True,
|
|
"Key 9": False,
|
|
"Key 10": None,
|
|
"Key 11": np.array([1, 2, 3]),
|
|
}
|
|
)
|
|
out = gr.JSON(label="OutputJSON")
|
|
btn = gr.Button("Submit")
|
|
btn.click(lambda x: x, inp, out)
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|