gradio/js/app/lite.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.4 KiB
HTML
Raw Normal View History

2023-07-07 01:43:49 +08:00
<!doctype html>
2023-06-27 15:09:50 +08:00
<!-- An entrypoint for the Wasm version development -->
2023-07-07 01:43:49 +08:00
<html style="margin: 0; padding: 0; height: 100%">
2023-06-27 15:09:50 +08:00
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<script type="module" src="./src/lite/index.ts"></script>
2023-06-27 15:09:50 +08:00
</head>
2023-07-07 01:43:49 +08:00
<body style="margin: 0; padding: 0; height: 100%">
2023-06-27 15:09:50 +08:00
<div id="gradio-app"></div>
<textarea id="code-input" cols="30" rows="10">
import gradio as gr
def greet(name):
return "Hello " + name + "!"
def upload_file(files):
file_paths = [file.name for file in files]
return file_paths
with gr.Blocks(theme=gr.themes.Soft()) as demo:
name = gr.Textbox(label="Name")
output = gr.Textbox(label="Output Box")
greet_btn = gr.Button("Greet")
greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")
gr.File()
file_output = gr.File()
upload_button = gr.UploadButton("Click to Upload a File", file_types=["image", "video"], file_count="multiple")
upload_button.upload(upload_file, upload_button, file_output)
demo.launch()
2023-07-07 01:43:49 +08:00
</textarea
>
<button id="exec-button">Execute</button>
<textarea id="requirements-input"></textarea>
<button id="install-button">Install</button>
2023-06-27 15:09:50 +08:00
</body>
</html>