2023-07-07 01:43:49 +08:00
|
|
|
<!doctype html>
|
2023-06-27 15:09:50 +08:00
|
|
|
<!-- A demo HTML file to test the bundled JS and CSS files -->
|
2023-06-30 17:07:28 +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"
|
|
|
|
/>
|
2023-06-30 17:07:28 +08:00
|
|
|
|
|
|
|
<script type="module" crossorigin src="./dist/lite.js"></script>
|
|
|
|
<link rel="stylesheet" href="./dist/lite.css" />
|
2023-06-27 15:09:50 +08:00
|
|
|
</head>
|
|
|
|
|
2023-06-30 17:07:28 +08:00
|
|
|
<body style="margin: 0; padding: 0; height: 100%">
|
2023-06-27 15:09:50 +08:00
|
|
|
<div id="gradio-app"></div>
|
|
|
|
|
2023-07-07 01:43:49 +08:00
|
|
|
<script type="module">
|
|
|
|
// type="module" is necessary to use `createGradioApp()`, which is loaded with <script type="module" /> tag above.
|
2023-06-27 15:09:50 +08:00
|
|
|
createGradioApp({
|
|
|
|
target: document.getElementById("gradio-app"),
|
2023-07-06 18:43:14 +08:00
|
|
|
code: `
|
2023-06-27 15:09:50 +08:00
|
|
|
import gradio as gr
|
|
|
|
|
|
|
|
def greet(name):
|
|
|
|
return "Hello " + name + "!"
|
|
|
|
|
|
|
|
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
|
|
|
|
|
|
|
demo.launch()
|
|
|
|
`,
|
|
|
|
info: true,
|
|
|
|
container: true,
|
|
|
|
isEmbed: false,
|
|
|
|
initialHeight: "300px",
|
|
|
|
eager: false,
|
|
|
|
themeMode: null,
|
|
|
|
autoScroll: false,
|
|
|
|
controlPageTitle: false,
|
|
|
|
appMode: true
|
|
|
|
});
|
2023-06-30 17:07:28 +08:00
|
|
|
</script>
|
|
|
|
</body>
|
2023-06-27 15:09:50 +08:00
|
|
|
</html>
|