lukemarsden commited on
Commit
e29f4a8
·
1 Parent(s): 95fa195

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. README.md +6 -7
  2. app.py +21 -0
  3. requirements.txt +70 -0
README.md CHANGED
@@ -1,11 +1,10 @@
1
  ---
2
  title: Demo
3
- emoji: 📚
4
- colorFrom: indigo
5
- colorTo: yellow
6
- sdk: docker
 
 
7
  pinned: false
8
- license: apache-2.0
9
  ---
10
-
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
  title: Demo
3
+ emoji: 🐨
4
+ colorFrom: green
5
+ colorTo: blue
6
+ sdk: gradio
7
+ sdk_version: 3.29.0
8
+ app_file: app.py
9
  pinned: false
 
10
  ---
 
 
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio
3
+
4
+
5
+ model = pipeline(
6
+ "summarization",
7
+ model="sshleifer/distilbart-cnn-12-6",
8
+ )
9
+
10
+
11
+ def predict(prompt):
12
+ summary = model(prompt)[0]["summary_text"]
13
+ return summary
14
+
15
+
16
+ if __name__ == '__main__':
17
+ with gradio.Interface(predict,
18
+ "textbox",
19
+ "text",
20
+ allow_flagging="never") as interface:
21
+ interface.launch()
requirements.txt ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.1.0
2
+ aiohttp==3.8.4
3
+ aiosignal==1.3.1
4
+ altair==5.0.0
5
+ anyio==3.6.2
6
+ async-timeout==4.0.2
7
+ attrs==23.1.0
8
+ certifi==2023.5.7
9
+ charset-normalizer==3.1.0
10
+ click==8.1.3
11
+ contourpy==1.0.7
12
+ cycler==0.11.0
13
+ fastapi==0.95.2
14
+ ffmpy==0.3.0
15
+ filelock==3.12.0
16
+ fonttools==4.39.4
17
+ frozenlist==1.3.3
18
+ fsspec==2023.5.0
19
+ gradio==3.31.0
20
+ gradio_client==0.2.5
21
+ h11==0.14.0
22
+ httpcore==0.17.1
23
+ httpx==0.24.0
24
+ huggingface-hub==0.14.1
25
+ idna==3.4
26
+ Jinja2==3.1.2
27
+ jsonschema==4.17.3
28
+ kiwisolver==1.4.4
29
+ linkify-it-py==2.0.2
30
+ markdown-it-py==2.2.0
31
+ MarkupSafe==2.1.2
32
+ matplotlib==3.7.1
33
+ mdit-py-plugins==0.3.3
34
+ mdurl==0.1.2
35
+ mpmath==1.3.0
36
+ multidict==6.0.4
37
+ networkx==3.1
38
+ numpy==1.24.3
39
+ orjson==3.8.12
40
+ packaging==23.1
41
+ pandas==2.0.1
42
+ Pillow==9.5.0
43
+ pydantic==1.10.7
44
+ pydub==0.25.1
45
+ Pygments==2.15.1
46
+ pyparsing==3.0.9
47
+ pyrsistent==0.19.3
48
+ python-dateutil==2.8.2
49
+ python-multipart==0.0.6
50
+ pytz==2023.3
51
+ PyYAML==6.0
52
+ regex==2023.5.5
53
+ requests==2.30.0
54
+ semantic-version==2.10.0
55
+ six==1.16.0
56
+ sniffio==1.3.0
57
+ starlette==0.27.0
58
+ sympy==1.12
59
+ tokenizers==0.13.3
60
+ toolz==0.12.0
61
+ torch==2.0.1
62
+ tqdm==4.65.0
63
+ transformers==4.29.2
64
+ typing_extensions==4.5.0
65
+ tzdata==2023.3
66
+ uc-micro-py==1.0.2
67
+ urllib3==2.0.2
68
+ uvicorn==0.22.0
69
+ websockets==11.0.3
70
+ yarl==1.9.2