abidlabs HF staff commited on
Commit
4920445
1 Parent(s): 4614c9a

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +26 -14
index.html CHANGED
@@ -1,19 +1,31 @@
1
  <!DOCTYPE html>
2
  <html>
3
  <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
  </head>
9
  <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <!DOCTYPE html>
2
  <html>
3
  <head>
4
+ <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite@0.4.1/dist/lite.js"></script>
5
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite@0.4.1/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>