reach-vb HF Staff commited on
Commit
ec8b5c1
·
1 Parent(s): 9bcb716

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +44 -14
index.html CHANGED
@@ -1,19 +1,49 @@
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
+ <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>