RelativelyUnique commited on
Commit
6502659
1 Parent(s): 0dfe586

first import

Browse files
Files changed (2) hide show
  1. app.py +16 -0
  2. requirements.txt +157 -0
app.py CHANGED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import transformers
3
+
4
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
5
+ from transformers import pipeline
6
+
7
+ model = AutoModelForSequenceClassification.from_pretrained('mrcoombes/distilbert-wikipedia-pokemon')
8
+ tokenizer = AutoTokenizer.from_pretrained('distilbert-base-uncased')
9
+
10
+ classifier = pipeline('text-classification', model = model, tokenizer=tokenizer, return_all_scores=True)
11
+
12
+ clf = lambda x: sorted(classifier(x)[0], key=lambda y: y['score'], reverse=True)
13
+
14
+ demo = gr.Interface(fn=clf, inputs="text", outputs="text")
15
+
16
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiohttp==3.8.1; python_version >= "3.6"
2
+ aiosignal==1.2.0; python_version >= "3.6"
3
+ altair==4.2.0; python_version >= "3.7"
4
+ analytics-python==1.4.0
5
+ anyio==3.6.1; python_full_version >= "3.6.2" and python_version >= "3.7"
6
+ appnope==0.1.3; sys_platform == "darwin" and python_version >= "3.8" and platform_system == "Darwin"
7
+ argon2-cffi-bindings==21.2.0; python_version >= "3.7"
8
+ argon2-cffi==21.3.0; python_version >= "3.7"
9
+ asgiref==3.5.2; python_version >= "3.7"
10
+ asttokens==2.0.5; python_version >= "3.8"
11
+ async-timeout==4.0.2; python_version >= "3.6"
12
+ attrs==21.4.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
13
+ babel==2.10.1; python_version >= "3.7"
14
+ backcall==0.2.0; python_version >= "3.8"
15
+ backoff==1.10.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
16
+ bcrypt==3.2.2; python_version >= "3.6"
17
+ beautifulsoup4==4.11.1; python_full_version >= "3.6.0"
18
+ bleach==5.0.0; python_version >= "3.7"
19
+ blinker==1.4; python_version >= "3.6"
20
+ cachetools==5.2.0; python_version >= "3.7" and python_version < "4.0"
21
+ certifi==2022.5.18.1; python_full_version >= "3.7.0" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0") and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
22
+ cffi==1.15.0; implementation_name == "pypy" and python_version >= "3.7"
23
+ charset-normalizer==2.0.12; python_full_version >= "3.7.0" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0") and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
24
+ click==8.0.4; python_version >= "3.7"
25
+ colorama==0.4.4; sys_platform == "win32" and python_version >= "3.8" and python_full_version >= "3.7.0" and platform_system == "Windows"
26
+ cryptography==37.0.2; python_version >= "3.6"
27
+ cycler==0.11.0; python_version >= "3.7"
28
+ debugpy==1.6.0; python_version >= "3.7"
29
+ decorator==5.1.1; python_version >= "3.8"
30
+ defusedxml==0.7.1; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
31
+ entrypoints==0.4; python_version >= "3.7"
32
+ executing==0.8.3; python_version >= "3.8"
33
+ fastapi==0.78.0; python_full_version >= "3.6.1"
34
+ fastjsonschema==2.15.3; python_version >= "3.7"
35
+ ffmpy==0.3.0
36
+ filelock==3.7.1; python_version >= "3.7" and python_full_version >= "3.7.0"
37
+ fonttools==4.33.3; python_version >= "3.7"
38
+ frozenlist==1.3.0; python_version >= "3.7"
39
+ gitdb==4.0.9; python_version >= "3.7"
40
+ gitpython==3.1.27; python_version >= "3.7"
41
+ gradio==3.0.11
42
+ h11==0.13.0; python_version >= "3.7"
43
+ huggingface-hub==0.7.0; python_full_version >= "3.7.0"
44
+ idna==3.3; python_full_version >= "3.7.0" and python_version >= "3.7" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0") and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
45
+ importlib-metadata==4.11.4; python_version >= "3.7"
46
+ ipykernel==6.13.0; python_version >= "3.7"
47
+ ipython-genutils==0.2.0; python_version >= "3.7"
48
+ ipython==8.4.0; python_version >= "3.8"
49
+ ipywidgets==7.7.0; python_version >= "3.7"
50
+ jedi==0.18.1; python_version >= "3.8"
51
+ jinja2==3.1.2; python_version >= "3.7"
52
+ joblib==1.1.0; python_version >= "3.8"
53
+ json5==0.9.8; python_version >= "3.7"
54
+ jsonschema==4.5.1; python_version >= "3.7"
55
+ jupyter-client==7.3.1; python_full_version >= "3.7.0" and python_version >= "3.7"
56
+ jupyter-core==4.10.0; python_version >= "3.7"
57
+ jupyter-server==1.17.0; python_version >= "3.7"
58
+ jupyterlab-pygments==0.2.2; python_version >= "3.7"
59
+ jupyterlab-server==2.14.0; python_version >= "3.7"
60
+ jupyterlab-widgets==1.1.0; python_version >= "3.7"
61
+ jupyterlab==3.4.2; python_version >= "3.7"
62
+ kiwisolver==1.4.2; python_version >= "3.7"
63
+ linkify-it-py==1.0.3; python_version >= "3.7"
64
+ lxml==4.8.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
65
+ markdown-it-py==2.1.0; python_version >= "3.7" and python_version < "4.0"
66
+ markupsafe==2.1.1; python_version >= "3.7"
67
+ matplotlib-inline==0.1.3; python_version >= "3.8"
68
+ matplotlib==3.5.2; python_version >= "3.7"
69
+ mdit-py-plugins==0.3.0; python_version >= "3.7" and python_version < "4.0"
70
+ mdurl==0.1.1; python_version >= "3.7"
71
+ mistune==0.8.4; python_version >= "3.7"
72
+ monotonic==1.6
73
+ multidict==6.0.2; python_version >= "3.7"
74
+ nbclassic==0.3.7; python_version >= "3.7"
75
+ nbclient==0.6.3; python_full_version >= "3.7.0" and python_version >= "3.7"
76
+ nbconvert==6.5.0; python_version >= "3.7"
77
+ nbformat==5.4.0; python_full_version >= "3.7.0" and python_version >= "3.7"
78
+ nest-asyncio==1.5.5; python_full_version >= "3.7.0" and python_version >= "3.7"
79
+ notebook-shim==0.1.0; python_version >= "3.7"
80
+ notebook==6.4.11; python_version >= "3.7"
81
+ numpy==1.22.4; python_version >= "3.8"
82
+ orjson==3.7.1; python_version >= "3.7"
83
+ packaging==21.3; python_version >= "3.7" and python_full_version >= "3.7.0"
84
+ pandas==1.4.2; python_version >= "3.8"
85
+ pandocfilters==1.5.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7"
86
+ paramiko==2.11.0
87
+ parso==0.8.3; python_version >= "3.8"
88
+ pexpect==4.8.0; sys_platform != "win32" and python_version >= "3.8"
89
+ pickleshare==0.7.5; python_version >= "3.8"
90
+ pillow==9.1.1; python_version >= "3.7"
91
+ prometheus-client==0.14.1; python_version >= "3.7"
92
+ prompt-toolkit==3.0.29; python_full_version >= "3.6.2" and python_version >= "3.8"
93
+ protobuf==3.20.1; python_version >= "3.7"
94
+ psutil==5.9.1; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7"
95
+ ptyprocess==0.7.0; sys_platform != "win32" and python_version >= "3.8" and os_name != "nt"
96
+ pure-eval==0.2.2; python_version >= "3.8"
97
+ py==1.11.0; python_version >= "3.7" and python_full_version < "3.0.0" and implementation_name == "pypy" or implementation_name == "pypy" and python_version >= "3.7" and python_full_version >= "3.5.0"
98
+ pyarrow==8.0.0; python_version >= "3.7"
99
+ pycparser==2.21; python_version >= "3.7" and python_full_version < "3.0.0" and implementation_name == "pypy" or implementation_name == "pypy" and python_version >= "3.7" and python_full_version >= "3.4.0"
100
+ pycryptodome==3.14.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
101
+ pydantic==1.9.1; python_full_version >= "3.6.1"
102
+ pydeck==0.7.1; python_version >= "3.7"
103
+ pydub==0.25.1
104
+ pygments==2.12.0; python_version >= "3.8"
105
+ pympler==1.0.1; python_version >= "3.6"
106
+ pynacl==1.5.0; python_version >= "3.6"
107
+ pyparsing==3.0.9; python_version >= "3.7" and python_full_version >= "3.7.0"
108
+ pyrsistent==0.18.1; python_version >= "3.7"
109
+ python-dateutil==2.8.2; python_version >= "3.8" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.8"
110
+ python-multipart==0.0.5
111
+ pytz-deprecation-shim==0.1.0.post0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6"
112
+ pytz==2022.1; python_version >= "3.8"
113
+ pywin32==304; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.7"
114
+ pywinpty==2.0.5; os_name == "nt" and python_version >= "3.7"
115
+ pyyaml==6.0; python_version >= "3.6" and python_full_version >= "3.7.0"
116
+ pyzmq==23.0.0; python_version >= "3.7"
117
+ regex==2022.4.24; python_version >= "3.6" and python_full_version >= "3.7.0"
118
+ requests==2.27.1; python_full_version >= "3.7.0" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0") and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
119
+ scikit-learn==1.1.1; python_version >= "3.8"
120
+ scipy==1.8.1; python_version >= "3.8" and python_version < "3.11"
121
+ seaborn==0.11.2; python_version >= "3.6"
122
+ semver==2.13.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
123
+ send2trash==1.8.0; python_version >= "3.7"
124
+ setuptools-scm==6.4.2; python_version >= "3.7"
125
+ six==1.16.0; python_version >= "3.8" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.8"
126
+ smmap==5.0.0; python_version >= "3.7"
127
+ sniffio==1.2.0; python_full_version >= "3.6.2" and python_version >= "3.7"
128
+ soupsieve==2.3.2.post1; python_version >= "3.7" and python_full_version >= "3.6.0"
129
+ stack-data==0.2.0; python_version >= "3.8"
130
+ starlette==0.19.1; python_version >= "3.6" and python_full_version >= "3.6.1"
131
+ streamlit==1.9.2; python_version >= "3.6"
132
+ terminado==0.15.0; python_version >= "3.7"
133
+ threadpoolctl==3.1.0; python_version >= "3.8"
134
+ tinycss2==1.1.1; python_version >= "3.7"
135
+ tokenizers==0.12.1; python_full_version >= "3.7.0"
136
+ toml==0.10.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6"
137
+ tomli==2.0.1; python_version >= "3.7"
138
+ toolz==0.11.2; python_version >= "3.7"
139
+ torch==1.11.0; python_full_version >= "3.7.0"
140
+ tornado==6.1; python_version >= "3.7"
141
+ tqdm==4.64.0; python_full_version >= "3.7.0"
142
+ traitlets==5.2.1.post0; python_full_version >= "3.7.0" and python_version >= "3.8"
143
+ transformers==4.19.2; python_full_version >= "3.7.0"
144
+ typing-extensions==4.2.0; python_version >= "3.7" and python_full_version >= "3.7.0"
145
+ tzdata==2022.1; platform_system == "Windows" and python_version >= "3.6" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6")
146
+ tzlocal==4.2; python_version >= "3.6"
147
+ uc-micro-py==1.0.1; python_version >= "3.7"
148
+ urllib3==1.26.9; python_full_version >= "3.7.0" and python_version < "4" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0") and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
149
+ uvicorn==0.17.6; python_version >= "3.7"
150
+ validators==0.19.0; python_version >= "3.6"
151
+ watchdog==2.1.8; platform_system != "Darwin" and python_version >= "3.6"
152
+ wcwidth==0.2.5; python_full_version >= "3.6.2" and python_version >= "3.8"
153
+ webencodings==0.5.1; python_version >= "3.7"
154
+ websocket-client==1.3.2; python_version >= "3.7"
155
+ widgetsnbextension==3.6.0; python_version >= "3.7"
156
+ yarl==1.7.2; python_version >= "3.6"
157
+ zipp==3.8.0; python_version >= "3.7"