franz96521 commited on
Commit
4974498
·
1 Parent(s): fa4adab

Test Final

Browse files
Files changed (3) hide show
  1. app.py +26 -30
  2. packages.txt +0 -0
  3. requirementsconda.txt +0 -197
app.py CHANGED
@@ -1,31 +1,27 @@
1
- import gpt_2_simple as gpt2
2
- import tensorflow as tf
3
- import gradio as gr
4
-
5
- model_name = "124M"
6
-
7
- path = 'AbstractGenerator/'
8
- checkpoint_dir =path+'weights/'
9
- data_path = path+'Tokenized_data/'
10
-
11
-
12
- prefix= '<|startoftext|>'
13
- sufix ='<|endoftext|>'
14
-
15
- print("GPU is", "available" if tf.test.is_gpu_available() else "NOT AVAILABLE")
16
-
17
- sess = gpt2.start_tf_sess()
18
- gpt2.load_gpt2(sess,checkpoint_dir=checkpoint_dir,run_name='run1')
19
-
20
-
21
-
22
-
23
-
24
- def greet(text):
25
- return gpt2.generate(sess,prefix=text,truncate=sufix,checkpoint_dir=checkpoint_dir,nsamples=1)
26
-
27
-
28
-
29
-
30
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
31
  iface.launch()
 
1
+ import gpt_2_simple as gpt2
2
+ import tensorflow as tf
3
+ import gradio as gr
4
+
5
+ model_name = "124M"
6
+
7
+ path = 'AbstractGenerator/'
8
+ checkpoint_dir =path+'weights/'
9
+ data_path = path+'Tokenized_data/'
10
+
11
+
12
+ prefix= '<|startoftext|>'
13
+ sufix ='<|endoftext|>'
14
+
15
+ print("GPU is", "available" if tf.test.is_gpu_available() else "NOT AVAILABLE")
16
+
17
+
18
+ def generateAbstract(text):
19
+ sess = gpt2.start_tf_sess()
20
+ gpt2.load_gpt2(sess,checkpoint_dir=checkpoint_dir,run_name='run1')
21
+ txt = gpt2.generate(sess,prefix=str(text)+"\nABSTRACT", return_as_list=True,truncate=sufix,checkpoint_dir=checkpoint_dir,nsamples=1)[0]
22
+ return str(txt[txt.find('ABSTRACT'):])
23
+
24
+
25
+
26
+ iface = gr.Interface(fn=generateAbstract, inputs=gr.inputs.Textbox(lines=10, placeholder="text"), outputs="textbox")
 
 
 
 
27
  iface.launch()
packages.txt DELETED
File without changes
requirementsconda.txt DELETED
@@ -1,197 +0,0 @@
1
- # This file may be used to create an environment using:
2
- # $ conda create --name <env> --file <this file>
3
- # platform: win-64
4
- _tflow_select=2.1.0=gpu
5
- absl-py=0.15.0=pyhd3eb1b0_0
6
- aiohttp=3.8.1=py37h2bbff1b_0
7
- aiosignal=1.2.0=pyhd3eb1b0_0
8
- analytics-python=1.4.0=pypi_0
9
- anyio=3.5.0=pypi_0
10
- argcomplete=1.12.3=pyhd3eb1b0_0
11
- argon2-cffi=21.3.0=pyhd3eb1b0_0
12
- argon2-cffi-bindings=21.2.0=py37h2bbff1b_0
13
- asgiref=3.5.0=pypi_0
14
- astor=0.8.1=py37haa95532_0
15
- astunparse=1.6.3=pypi_0
16
- async-timeout=4.0.1=pyhd3eb1b0_0
17
- asynctest=0.13.0=py_0
18
- attrs=21.4.0=pyhd3eb1b0_0
19
- backcall=0.2.0=pyhd3eb1b0_0
20
- backoff=1.10.0=pypi_0
21
- bcrypt=3.2.0=pypi_0
22
- blas=1.0=mkl
23
- bleach=4.1.0=pyhd3eb1b0_0
24
- blinker=1.4=py37haa95532_0
25
- bottleneck=1.3.2=py37h2a96729_1
26
- brotlipy=0.7.0=py37h2bbff1b_1003
27
- ca-certificates=2022.2.1=haa95532_0
28
- cached-property=1.5.2=py_0
29
- cachetools=4.2.2=pyhd3eb1b0_0
30
- certifi=2021.10.8=py37haa95532_2
31
- cffi=1.15.0=py37h2bbff1b_1
32
- charset-normalizer=2.0.4=pyhd3eb1b0_0
33
- click=8.0.4=py37haa95532_0
34
- colorama=0.4.4=pyhd3eb1b0_0
35
- cryptography=3.4.8=py37h71e12ea_0
36
- cudatoolkit=10.0.130=0
37
- cudnn=7.6.5=cuda10.0_0
38
- cycler=0.11.0=pypi_0
39
- debugpy=1.5.1=py37hd77b12b_0
40
- decorator=5.1.1=pyhd3eb1b0_0
41
- defusedxml=0.7.1=pyhd3eb1b0_0
42
- entrypoints=0.3=py37_0
43
- fastapi=0.75.0=pypi_0
44
- ffmpy=0.3.0=pypi_0
45
- filelock=3.6.0=pypi_0
46
- flatbuffers=2.0=pypi_0
47
- fonttools=4.31.2=pypi_0
48
- frozenlist=1.2.0=py37h2bbff1b_0
49
- gast=0.2.2=py37_0
50
- google-auth=2.6.0=pyhd3eb1b0_0
51
- google-auth-oauthlib=0.4.4=pyhd3eb1b0_0
52
- google-pasta=0.2.0=pyhd3eb1b0_0
53
- gpt-2-simple=0.8.1=pypi_0
54
- gradio=2.8.13=pypi_0
55
- grpcio=1.42.0=py37hc60d5dd_0
56
- h11=0.13.0=pypi_0
57
- h5py=3.6.0=py37h3de5c98_0
58
- hdf5=1.10.6=h7ebc959_0
59
- huggingface-hub=0.4.0=pypi_0
60
- icc_rt=2019.0.0=h0cc432a_1
61
- icu=58.2=ha925a31_3
62
- idna=3.3=pyhd3eb1b0_0
63
- importlib-metadata=4.8.2=py37haa95532_0
64
- importlib_metadata=4.8.2=hd3eb1b0_0
65
- intel-openmp=2021.4.0=haa95532_3556
66
- ipykernel=6.4.1=py37haa95532_1
67
- ipython=7.31.1=py37haa95532_0
68
- ipython_genutils=0.2.0=pyhd3eb1b0_1
69
- ipywidgets=7.6.5=pyhd3eb1b0_1
70
- jedi=0.18.1=py37haa95532_1
71
- jinja2=3.0.2=pyhd3eb1b0_0
72
- jpeg=9d=h2bbff1b_0
73
- jsonschema=3.2.0=pyhd3eb1b0_2
74
- jupyter=1.0.0=py37_7
75
- jupyter_client=7.1.2=pyhd3eb1b0_0
76
- jupyter_console=6.4.0=pyhd3eb1b0_0
77
- jupyter_core=4.9.1=py37haa95532_0
78
- jupyterlab_pygments=0.1.2=py_0
79
- jupyterlab_widgets=1.0.0=pyhd3eb1b0_1
80
- keras=2.8.0=pypi_0
81
- keras-applications=1.0.8=py_1
82
- keras-preprocessing=1.1.2=pyhd3eb1b0_0
83
- kiwisolver=1.4.0=pypi_0
84
- libclang=13.0.0=pypi_0
85
- libpng=1.6.37=h2a8f88b_0
86
- libprotobuf=3.19.1=h23ce68f_0
87
- linkify-it-py=1.0.3=pypi_0
88
- markdown=3.3.4=py37haa95532_0
89
- markdown-it-py=2.0.1=pypi_0
90
- markupsafe=2.0.1=py37h2bbff1b_0
91
- matplotlib=3.5.1=pypi_0
92
- matplotlib-inline=0.1.2=pyhd3eb1b0_2
93
- mdit-py-plugins=0.3.0=pypi_0
94
- mdurl=0.1.0=pypi_0
95
- mistune=0.8.4=py37hfa6e2cd_1001
96
- mkl=2021.4.0=haa95532_640
97
- mkl-service=2.4.0=py37h2bbff1b_0
98
- mkl_fft=1.3.1=py37h277e83a_0
99
- mkl_random=1.2.2=py37hf11a4ad_0
100
- monotonic=1.6=pypi_0
101
- multidict=5.1.0=py37h2bbff1b_2
102
- nbclient=0.5.11=pyhd3eb1b0_0
103
- nbconvert=6.1.0=py37haa95532_0
104
- nbformat=5.1.3=pyhd3eb1b0_0
105
- nest-asyncio=1.5.1=pyhd3eb1b0_0
106
- notebook=6.4.8=py37haa95532_0
107
- numexpr=2.8.1=py37hb80d3ca_0
108
- numpy=1.21.5=py37ha4e8547_0
109
- numpy-base=1.21.5=py37hc2deb75_0
110
- oauthlib=3.2.0=pyhd3eb1b0_0
111
- openssl=1.1.1m=h2bbff1b_0
112
- opt_einsum=3.3.0=pyhd3eb1b0_1
113
- orjson=3.6.7=pypi_0
114
- packaging=21.3=pyhd3eb1b0_0
115
- pandas=1.3.5=py37h6214cd6_0
116
- pandocfilters=1.5.0=pyhd3eb1b0_0
117
- paramiko=2.10.3=pypi_0
118
- parso=0.8.3=pyhd3eb1b0_0
119
- pickleshare=0.7.5=pyhd3eb1b0_1003
120
- pillow=9.0.1=pypi_0
121
- pip=22.0.4=pypi_0
122
- prometheus_client=0.13.1=pyhd3eb1b0_0
123
- prompt-toolkit=3.0.20=pyhd3eb1b0_0
124
- prompt_toolkit=3.0.20=hd3eb1b0_0
125
- protobuf=3.19.1=py37hd77b12b_0
126
- pyasn1=0.4.8=pyhd3eb1b0_0
127
- pyasn1-modules=0.2.8=py_0
128
- pycparser=2.21=pyhd3eb1b0_0
129
- pycryptodome=3.14.1=pypi_0
130
- pydantic=1.9.0=pypi_0
131
- pydub=0.25.1=pypi_0
132
- pygments=2.11.2=pyhd3eb1b0_0
133
- pyjwt=2.1.0=py37haa95532_0
134
- pynacl=1.5.0=pypi_0
135
- pyopenssl=21.0.0=pyhd3eb1b0_1
136
- pyparsing=3.0.4=pyhd3eb1b0_0
137
- pyqt=5.9.2=py37hd77b12b_6
138
- pyreadline=2.1=py37_1
139
- pyrsistent=0.18.0=py37h196d8e1_0
140
- pysocks=1.7.1=py37_1
141
- python=3.7.11=h6244533_0
142
- python-dateutil=2.8.2=pyhd3eb1b0_0
143
- python-multipart=0.0.5=pypi_0
144
- pytz=2021.3=pyhd3eb1b0_0
145
- pywin32=302=py37h827c3e9_1
146
- pywinpty=2.0.2=py37h5da7b33_0
147
- pyyaml=6.0=pypi_0
148
- pyzmq=22.3.0=py37hd77b12b_2
149
- qt=5.9.7=vc14h73c81de_0
150
- qtconsole=5.2.2=pyhd3eb1b0_0
151
- qtpy=1.11.2=pyhd3eb1b0_0
152
- regex=2022.3.2=pypi_0
153
- requests=2.27.1=pyhd3eb1b0_0
154
- requests-oauthlib=1.3.0=py_0
155
- rsa=4.7.2=pyhd3eb1b0_1
156
- scipy=1.7.3=py37h0a974cb_0
157
- send2trash=1.8.0=pyhd3eb1b0_1
158
- setuptools=58.0.4=py37haa95532_0
159
- sip=4.19.13=py37hd77b12b_0
160
- six=1.16.0=pyhd3eb1b0_1
161
- sniffio=1.2.0=pypi_0
162
- sqlite=3.37.2=h2bbff1b_0
163
- starlette=0.17.1=pypi_0
164
- tensorboard=1.15.0=pypi_0
165
- tensorboard-data-server=0.6.1=pypi_0
166
- tensorboard-plugin-wit=1.6.0=py_0
167
- tensorflow=2.8.0=pypi_0
168
- tensorflow-estimator=1.15.1=pypi_0
169
- tensorflow-gpu=1.15.0=pypi_0
170
- tensorflow-io-gcs-filesystem=0.24.0=pypi_0
171
- termcolor=1.1.0=py37haa95532_1
172
- terminado=0.13.1=py37haa95532_0
173
- testpath=0.5.0=pyhd3eb1b0_0
174
- tf-estimator-nightly=2.8.0.dev2021122109=pypi_0
175
- toposort=1.7=pypi_0
176
- tornado=6.1=py37h2bbff1b_0
177
- tqdm=4.63.0=pypi_0
178
- traitlets=5.1.1=pyhd3eb1b0_0
179
- typing-extensions=3.10.0.2=hd3eb1b0_0
180
- typing_extensions=3.10.0.2=pyh06a4308_0
181
- uc-micro-py=1.0.1=pypi_0
182
- urllib3=1.26.8=pyhd3eb1b0_0
183
- uvicorn=0.17.6=pypi_0
184
- vc=14.2=h21ff451_1
185
- vs2015_runtime=14.27.29016=h5e58377_2
186
- wcwidth=0.2.5=pyhd3eb1b0_0
187
- webencodings=0.5.1=py37_1
188
- werkzeug=0.16.1=py_0
189
- wheel=0.37.1=pyhd3eb1b0_0
190
- widgetsnbextension=3.5.2=py37haa95532_0
191
- win_inet_pton=1.1.0=py37haa95532_0
192
- wincertstore=0.2=py37haa95532_2
193
- winpty=0.4.3=4
194
- wrapt=1.13.3=py37h2bbff1b_2
195
- yarl=1.6.3=py37h2bbff1b_0
196
- zipp=3.7.0=pyhd3eb1b0_0
197
- zlib=1.2.11=h8cc25b3_4