Spaces:
Build error
Build error
Commit
·
ea851c3
1
Parent(s):
40a467c
working
Browse files- .env +1 -0
- app.py +20 -6
- environment.yml +279 -0
.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
'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'
|
app.py
CHANGED
|
@@ -1,10 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import openai
|
| 3 |
import os
|
|
|
|
|
|
|
| 4 |
|
| 5 |
openai.api_key = os.getenv("api_key")
|
| 6 |
|
| 7 |
-
def run_ai(name,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
name = name.lower()
|
| 10 |
|
|
@@ -14,9 +21,10 @@ def run_ai(name, words):
|
|
| 14 |
model="gpt-3.5-turbo",
|
| 15 |
messages=[
|
| 16 |
{"role": "user", "content": "You are a public relations consultant that works woth companies to get articles published for them. Your current task is to draft an email about the company or product that will be used to email editors at large news publications."},
|
| 17 |
-
{"role": "user", "content": "The action you are asking is for an article to be created and published on a new release."},
|
| 18 |
{"role": "user", "content": "I will be adding information that is relevent. Can you aggregate this information into an email to sent?"},
|
| 19 |
-
{"role": "user", "content":
|
|
|
|
|
|
|
| 20 |
{"role": "user", "content": "Draft email."}
|
| 21 |
]
|
| 22 |
)
|
|
@@ -28,8 +36,14 @@ def run_ai(name, words):
|
|
| 28 |
|
| 29 |
demo = gr.Interface(
|
| 30 |
fn=run_ai,
|
| 31 |
-
inputs=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
outputs=["text"],
|
| 33 |
)
|
| 34 |
-
|
| 35 |
-
demo.launch()
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import openai
|
| 3 |
import os
|
| 4 |
+
import requests as r
|
| 5 |
+
from bs4 import BeautifulSoup
|
| 6 |
|
| 7 |
openai.api_key = os.getenv("api_key")
|
| 8 |
|
| 9 |
+
def run_ai(name, website, additional_info, specific_request):
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
test = r.get(website)
|
| 13 |
+
soup = BeautifulSoup(test.text)
|
| 14 |
+
website_content = soup.get_text().replace('\n', '')
|
| 15 |
|
| 16 |
name = name.lower()
|
| 17 |
|
|
|
|
| 21 |
model="gpt-3.5-turbo",
|
| 22 |
messages=[
|
| 23 |
{"role": "user", "content": "You are a public relations consultant that works woth companies to get articles published for them. Your current task is to draft an email about the company or product that will be used to email editors at large news publications."},
|
|
|
|
| 24 |
{"role": "user", "content": "I will be adding information that is relevent. Can you aggregate this information into an email to sent?"},
|
| 25 |
+
{"role": "user", "content": f"Additional Background information: {website_content}"},
|
| 26 |
+
{"role": "user", "content": f"{additional_info}"},
|
| 27 |
+
{"role": "user", "content": f"The action you are asking is:{specific_request}"},
|
| 28 |
{"role": "user", "content": "Draft email."}
|
| 29 |
]
|
| 30 |
)
|
|
|
|
| 36 |
|
| 37 |
demo = gr.Interface(
|
| 38 |
fn=run_ai,
|
| 39 |
+
inputs=[
|
| 40 |
+
gr.Textbox(label="Last Name"),
|
| 41 |
+
gr.Textbox(label="Website (So we can learn more about your company or product.)", type='text', placeholder='https://huggingface.co/'),
|
| 42 |
+
gr.Textbox(lines=2, label="Anything specific that you want broadcasted?", placeholder='New product release that will disrupt public relations'),
|
| 43 |
+
gr.Textbox(lines=2, label="What do you want this person to do?", placeholder='Publish article on new release')
|
| 44 |
+
],
|
| 45 |
outputs=["text"],
|
| 46 |
)
|
| 47 |
+
demo.launch()
|
| 48 |
+
# demo.launch(share=True)
|
| 49 |
+
|
environment.yml
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: gradio
|
| 2 |
+
channels:
|
| 3 |
+
- conda-forge
|
| 4 |
+
- defaults
|
| 5 |
+
dependencies:
|
| 6 |
+
- _libgcc_mutex=0.1
|
| 7 |
+
- _openmp_mutex=5.1
|
| 8 |
+
- asttokens=2.0.5
|
| 9 |
+
- backcall=0.2.0
|
| 10 |
+
- blas=1.0
|
| 11 |
+
- bottleneck=1.3.5
|
| 12 |
+
- brotli=1.0.9
|
| 13 |
+
- brotli-bin=1.0.9
|
| 14 |
+
- ca-certificates=2022.07.19
|
| 15 |
+
- certifi=2022.6.15
|
| 16 |
+
- cudatoolkit=11.2.2
|
| 17 |
+
- cudnn=8.1.0.77
|
| 18 |
+
- cycler=0.11.0
|
| 19 |
+
- dbus=1.13.18
|
| 20 |
+
- debugpy=1.5.1
|
| 21 |
+
- decorator=5.1.1
|
| 22 |
+
- entrypoints=0.4
|
| 23 |
+
- executing=0.8.3
|
| 24 |
+
- expat=2.4.4
|
| 25 |
+
- fftw=3.3.9
|
| 26 |
+
- fontconfig=2.13.1
|
| 27 |
+
- fonttools=4.25.0
|
| 28 |
+
- freetype=2.11.0
|
| 29 |
+
- giflib=5.2.1
|
| 30 |
+
- glib=2.69.1
|
| 31 |
+
- gst-plugins-base=1.14.0
|
| 32 |
+
- gstreamer=1.14.0
|
| 33 |
+
- icu=58.2
|
| 34 |
+
- intel-openmp=2021.4.0
|
| 35 |
+
- ipykernel=6.9.1
|
| 36 |
+
- ipython=8.4.0
|
| 37 |
+
- jedi=0.18.1
|
| 38 |
+
- joblib=1.1.0
|
| 39 |
+
- jpeg=9e
|
| 40 |
+
- jupyter_client=7.3.4
|
| 41 |
+
- jupyter_core=4.10.0
|
| 42 |
+
- kiwisolver=1.4.2
|
| 43 |
+
- krb5=1.19.2
|
| 44 |
+
- lcms2=2.12
|
| 45 |
+
- ld_impl_linux-64=2.38
|
| 46 |
+
- lerc=3.0
|
| 47 |
+
- libbrotlicommon=1.0.9
|
| 48 |
+
- libbrotlidec=1.0.9
|
| 49 |
+
- libbrotlienc=1.0.9
|
| 50 |
+
- libdeflate=1.8
|
| 51 |
+
- libedit=3.1.20210910
|
| 52 |
+
- libevent=2.1.12
|
| 53 |
+
- libffi=3.3
|
| 54 |
+
- libgcc-ng=11.2.0
|
| 55 |
+
- libgfortran-ng=11.2.0
|
| 56 |
+
- libgfortran5=11.2.0
|
| 57 |
+
- libgomp=11.2.0
|
| 58 |
+
- libllvm10=10.0.1
|
| 59 |
+
- libpng=1.6.37
|
| 60 |
+
- libpq=12.9
|
| 61 |
+
- libsodium=1.0.18
|
| 62 |
+
- libstdcxx-ng=11.2.0
|
| 63 |
+
- libtiff=4.4.0
|
| 64 |
+
- libuuid=1.0.3
|
| 65 |
+
- libwebp=1.2.2
|
| 66 |
+
- libwebp-base=1.2.2
|
| 67 |
+
- libxcb=1.15
|
| 68 |
+
- libxkbcommon=1.0.1
|
| 69 |
+
- libxml2=2.9.14
|
| 70 |
+
- libxslt=1.1.35
|
| 71 |
+
- lz4-c=1.9.3
|
| 72 |
+
- matplotlib=3.5.2
|
| 73 |
+
- matplotlib-base=3.5.2
|
| 74 |
+
- matplotlib-inline=0.1.2
|
| 75 |
+
- mkl=2021.4.0
|
| 76 |
+
- mkl-service=2.4.0
|
| 77 |
+
- mkl_fft=1.3.1
|
| 78 |
+
- mkl_random=1.2.2
|
| 79 |
+
- munkres=1.1.4
|
| 80 |
+
- ncurses=6.3
|
| 81 |
+
- nest-asyncio=1.5.5
|
| 82 |
+
- nspr=4.33
|
| 83 |
+
- nss=3.74
|
| 84 |
+
- numexpr=2.8.3
|
| 85 |
+
- numpy=1.22.3
|
| 86 |
+
- numpy-base=1.22.3
|
| 87 |
+
- openssl=1.1.1q
|
| 88 |
+
- packaging=21.3
|
| 89 |
+
- pandas=1.4.3
|
| 90 |
+
- parso=0.8.3
|
| 91 |
+
- patsy=0.5.2
|
| 92 |
+
- pcre=8.45
|
| 93 |
+
- pexpect=4.8.0
|
| 94 |
+
- pickleshare=0.7.5
|
| 95 |
+
- pillow=9.2.0
|
| 96 |
+
- ply=3.11
|
| 97 |
+
- prompt-toolkit=3.0.20
|
| 98 |
+
- ptyprocess=0.7.0
|
| 99 |
+
- pure_eval=0.2.2
|
| 100 |
+
- pygments=2.11.2
|
| 101 |
+
- pyparsing=3.0.9
|
| 102 |
+
- pyqt=5.15.7
|
| 103 |
+
- pyqt5-sip=12.11.0
|
| 104 |
+
- python=3.9.12
|
| 105 |
+
- python-dateutil=2.8.2
|
| 106 |
+
- pytz=2022.1
|
| 107 |
+
- pyzmq=23.2.0
|
| 108 |
+
- qt-main=5.15.2
|
| 109 |
+
- qt-webengine=5.15.9
|
| 110 |
+
- qtwebkit=5.212
|
| 111 |
+
- readline=8.1.2
|
| 112 |
+
- scikit-learn=1.1.1
|
| 113 |
+
- scipy=1.7.3
|
| 114 |
+
- seaborn=0.11.2
|
| 115 |
+
- setuptools=63.4.1
|
| 116 |
+
- sip=6.6.2
|
| 117 |
+
- six=1.16.0
|
| 118 |
+
- sqlite=3.39.2
|
| 119 |
+
- stack_data=0.2.0
|
| 120 |
+
- statsmodels=0.13.2
|
| 121 |
+
- threadpoolctl=2.2.0
|
| 122 |
+
- tk=8.6.12
|
| 123 |
+
- toml=0.10.2
|
| 124 |
+
- tornado=6.1
|
| 125 |
+
- traitlets=5.1.1
|
| 126 |
+
- tzdata=2022a
|
| 127 |
+
- wcwidth=0.2.5
|
| 128 |
+
- wheel=0.37.1
|
| 129 |
+
- xz=5.2.5
|
| 130 |
+
- zeromq=4.3.4
|
| 131 |
+
- zlib=1.2.12
|
| 132 |
+
- zstd=1.5.2
|
| 133 |
+
- pip:
|
| 134 |
+
- absl-py==1.2.0
|
| 135 |
+
- aiofiles==23.1.0
|
| 136 |
+
- aiohttp==3.8.4
|
| 137 |
+
- aiosignal==1.3.1
|
| 138 |
+
- altair==4.2.2
|
| 139 |
+
- anyio==3.6.2
|
| 140 |
+
- astunparse==1.6.3
|
| 141 |
+
- async-timeout==4.0.2
|
| 142 |
+
- attrs==22.1.0
|
| 143 |
+
- beautifulsoup4==4.12.0
|
| 144 |
+
- bs4==0.0.1
|
| 145 |
+
- cachetools==5.2.0
|
| 146 |
+
- charset-normalizer==2.1.1
|
| 147 |
+
- click==8.1.3
|
| 148 |
+
- cloudpickle==2.2.0
|
| 149 |
+
- colorama==0.4.6
|
| 150 |
+
- cython==0.29.32
|
| 151 |
+
- dill==0.3.5.1
|
| 152 |
+
- dm-tree==0.1.7
|
| 153 |
+
- docker-pycreds==0.4.0
|
| 154 |
+
- etils==0.8.0
|
| 155 |
+
- fastapi==0.94.0
|
| 156 |
+
- fastjsonschema==2.16.2
|
| 157 |
+
- ffmpy==0.3.0
|
| 158 |
+
- filelock==3.8.0
|
| 159 |
+
- flatbuffers==1.12
|
| 160 |
+
- frozenlist==1.3.3
|
| 161 |
+
- fsspec==2023.3.0
|
| 162 |
+
- gast==0.4.0
|
| 163 |
+
- gin-config==0.5.0
|
| 164 |
+
- gitdb==4.0.10
|
| 165 |
+
- gitpython==3.1.29
|
| 166 |
+
- google-api-core==2.10.2
|
| 167 |
+
- google-api-python-client==2.66.0
|
| 168 |
+
- google-auth==2.11.0
|
| 169 |
+
- google-auth-httplib2==0.1.0
|
| 170 |
+
- google-auth-oauthlib==0.4.6
|
| 171 |
+
- google-pasta==0.2.0
|
| 172 |
+
- googleapis-common-protos==1.56.4
|
| 173 |
+
- gradio==3.20.1
|
| 174 |
+
- grpcio==1.47.0
|
| 175 |
+
- h11==0.14.0
|
| 176 |
+
- h5py==3.7.0
|
| 177 |
+
- httpcore==0.16.3
|
| 178 |
+
- httplib2==0.21.0
|
| 179 |
+
- httpx==0.23.3
|
| 180 |
+
- huggingface-hub==0.10.1
|
| 181 |
+
- idna==3.3
|
| 182 |
+
- immutabledict==2.2.3
|
| 183 |
+
- importlib-metadata==4.12.0
|
| 184 |
+
- importlib-resources==5.10.0
|
| 185 |
+
- jinja2==3.1.2
|
| 186 |
+
- jsonschema==4.16.0
|
| 187 |
+
- kaggle==1.5.12
|
| 188 |
+
- keras==2.9.0
|
| 189 |
+
- keras-preprocessing==1.1.2
|
| 190 |
+
- libclang==14.0.6
|
| 191 |
+
- linkify-it-py==2.0.0
|
| 192 |
+
- llvmlite==0.39.1
|
| 193 |
+
- lxml==4.9.1
|
| 194 |
+
- markdown==3.4.1
|
| 195 |
+
- markdown-it-py==2.2.0
|
| 196 |
+
- markupsafe==2.1.1
|
| 197 |
+
- mdit-py-plugins==0.3.3
|
| 198 |
+
- mdurl==0.1.2
|
| 199 |
+
- mlxtend==0.20.0
|
| 200 |
+
- multidict==6.0.4
|
| 201 |
+
- nbformat==5.7.0
|
| 202 |
+
- numba==0.56.3
|
| 203 |
+
- oauth2client==4.1.3
|
| 204 |
+
- oauthlib==3.2.0
|
| 205 |
+
- openai==0.27.2
|
| 206 |
+
- opencv-python-headless==4.5.2.52
|
| 207 |
+
- opt-einsum==3.3.0
|
| 208 |
+
- orjson==3.8.7
|
| 209 |
+
- pathtools==0.1.2
|
| 210 |
+
- pip==22.2.2
|
| 211 |
+
- plotly==5.10.0
|
| 212 |
+
- portalocker==2.6.0
|
| 213 |
+
- promise==2.3
|
| 214 |
+
- protobuf==3.19.6
|
| 215 |
+
- psutil==5.9.4
|
| 216 |
+
- py-cpuinfo==9.0.0
|
| 217 |
+
- pyasn1==0.4.8
|
| 218 |
+
- pyasn1-modules==0.2.8
|
| 219 |
+
- pycocotools==2.0.6
|
| 220 |
+
- pycryptodome==3.17
|
| 221 |
+
- pydantic==1.10.6
|
| 222 |
+
- pydub==0.25.1
|
| 223 |
+
- pyrsistent==0.18.1
|
| 224 |
+
- python-multipart==0.0.6
|
| 225 |
+
- python-slugify==7.0.0
|
| 226 |
+
- pyyaml==5.4.1
|
| 227 |
+
- regex==2022.10.31
|
| 228 |
+
- requests==2.28.1
|
| 229 |
+
- requests-oauthlib==1.3.1
|
| 230 |
+
- rfc3986==1.5.0
|
| 231 |
+
- rsa==4.9
|
| 232 |
+
- sacrebleu==2.3.1
|
| 233 |
+
- sentencepiece==0.1.97
|
| 234 |
+
- sentry-sdk==1.11.1
|
| 235 |
+
- seqeval==1.2.2
|
| 236 |
+
- setproctitle==1.3.2
|
| 237 |
+
- shap==0.41.0
|
| 238 |
+
- shortuuid==1.0.11
|
| 239 |
+
- slicer==0.0.7
|
| 240 |
+
- smmap==5.0.0
|
| 241 |
+
- sniffio==1.3.0
|
| 242 |
+
- soupsieve==2.4
|
| 243 |
+
- starlette==0.26.0.post1
|
| 244 |
+
- tabulate==0.9.0
|
| 245 |
+
- tenacity==8.1.0
|
| 246 |
+
- tensorboard==2.9.1
|
| 247 |
+
- tensorboard-data-server==0.6.1
|
| 248 |
+
- tensorboard-plugin-wit==1.8.1
|
| 249 |
+
- tensorflow==2.9.0
|
| 250 |
+
- tensorflow-addons==0.18.0
|
| 251 |
+
- tensorflow-datasets==4.7.0
|
| 252 |
+
- tensorflow-estimator==2.9.0
|
| 253 |
+
- tensorflow-hub==0.12.0
|
| 254 |
+
- tensorflow-io-gcs-filesystem==0.26.0
|
| 255 |
+
- tensorflow-metadata==1.10.0
|
| 256 |
+
- tensorflow-model-optimization==0.7.3
|
| 257 |
+
- tensorflow-text==2.11.0
|
| 258 |
+
- termcolor==1.1.0
|
| 259 |
+
- text-unidecode==1.3
|
| 260 |
+
- tf-models-official==2.11.0
|
| 261 |
+
- tf-slim==1.1.0
|
| 262 |
+
- tokenizers==0.13.1
|
| 263 |
+
- toolz==0.12.0
|
| 264 |
+
- tqdm==4.64.1
|
| 265 |
+
- transformers==4.24.0
|
| 266 |
+
- typeguard==2.13.3
|
| 267 |
+
- typing-extensions==4.3.0
|
| 268 |
+
- uc-micro-py==1.0.1
|
| 269 |
+
- uritemplate==4.1.1
|
| 270 |
+
- urllib3==1.26.12
|
| 271 |
+
- uvicorn==0.21.0
|
| 272 |
+
- wandb==0.13.5
|
| 273 |
+
- websockets==10.4
|
| 274 |
+
- werkzeug==2.2.2
|
| 275 |
+
- wordcloud==1.8.2.2
|
| 276 |
+
- wrapt==1.14.1
|
| 277 |
+
- yarl==1.8.2
|
| 278 |
+
- zipp==3.8.1
|
| 279 |
+
prefix: /home/joe/anaconda3/envs/gradio
|