Spaces:
Running
Running
Update index.html
Browse files- index.html +44 -14
index.html
CHANGED
@@ -1,19 +1,49 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
</head>
|
9 |
<body>
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto&display=swap" >
|
5 |
+
<style>
|
6 |
+
body {
|
7 |
+
font-family: 'Roboto', sans-serif;
|
8 |
+
font-size: 16px;
|
9 |
+
}
|
10 |
+
.logo {
|
11 |
+
height: 1em;
|
12 |
+
vertical-align: middle;
|
13 |
+
margin-bottom: 0.1em;
|
14 |
+
}
|
15 |
+
</style>
|
16 |
+
|
17 |
+
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/[email protected]/dist/lite.js"></script>
|
18 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/[email protected]/dist/lite.css" />
|
19 |
</head>
|
20 |
<body>
|
21 |
+
<h2>
|
22 |
+
<img src="lite-logo.png" alt="logo" class="logo">
|
23 |
+
Gradio-lite (Gradio running entirely in your browser!)
|
24 |
+
</h2>
|
25 |
+
<p>Try it out! Once the Gradio app loads (can take 10-15 seconds), disconnect your Wifi and the machine learning model will still work!</p>
|
26 |
+
<gradio-lite>
|
27 |
+
|
28 |
+
<gradio-requirements>
|
29 |
+
transformers_js_py
|
30 |
+
</gradio-requirements>
|
31 |
+
|
32 |
+
<gradio-file name="app.py" entrypoint>
|
33 |
+
from transformers_js import import_transformers_js
|
34 |
+
import gradio as gr
|
35 |
+
|
36 |
+
transformers = await import_transformers_js()
|
37 |
+
pipeline = transformers.pipeline
|
38 |
+
pipe = await pipeline(text-generation', 'Xenova/distilgpt2')
|
39 |
+
|
40 |
+
async def classify(text):
|
41 |
+
return await pipe(text)
|
42 |
+
|
43 |
+
demo = gr.Interface(classify, "textbox", "json", examples=["It's a happy day in the neighborhood", "I'm an evil penguin", "It wasn't a bad film."])
|
44 |
+
demo.launch()
|
45 |
+
</gradio-file>
|
46 |
+
|
47 |
+
</gradio-lite>
|
48 |
+
</body>
|
49 |
+
</html>
|