Spaces:
Running
Running
Update index.html
Browse files- index.html +26 -14
index.html
CHANGED
@@ -1,19 +1,31 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
-
<
|
5 |
-
<
|
6 |
-
<title>My static Space</title>
|
7 |
-
<link rel="stylesheet" href="style.css" />
|
8 |
</head>
|
9 |
<body>
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
<head>
|
4 |
+
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/[email protected]/dist/lite.js"></script>
|
5 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/[email protected]/dist/lite.css" />
|
|
|
|
|
6 |
</head>
|
7 |
<body>
|
8 |
+
<gradio-lite>
|
9 |
+
|
10 |
+
<gradio-requirements>
|
11 |
+
transformers_js_py
|
12 |
+
</gradio-requirements>
|
13 |
+
|
14 |
+
<gradio-file name="app.py" entrypoint>
|
15 |
+
from transformers_js import import_transformers_js
|
16 |
+
import gradio as gr
|
17 |
+
|
18 |
+
transformers = await import_transformers_js()
|
19 |
+
pipeline = transformers.pipeline
|
20 |
+
pipe = await pipeline('sentiment-analysis')
|
21 |
+
|
22 |
+
async def classify(text):
|
23 |
+
return await pipe(text)
|
24 |
+
|
25 |
+
demo = gr.Interface(classify, "textbox", "json")
|
26 |
+
demo.launch()
|
27 |
+
</gradio-file>
|
28 |
+
|
29 |
+
</gradio-lite>
|
30 |
+
</body>
|
31 |
+
</html>
|