Evan Lesmez commited on
Commit
d93c42d
1 Parent(s): 18ae67a

Simplify dependency management with pipreqs

Browse files
.gitignore CHANGED
@@ -1,2 +1,5 @@
1
  .env
2
- *__pycache__
 
 
 
 
1
  .env
2
+ env/
3
+ *__pycache__
4
+ *.pyc
5
+ *.ipynb_checkpoints
README.md CHANGED
@@ -9,9 +9,8 @@ app_file: chatbot/app.py
9
  pinned: false
10
  license: unknown
11
  ---
12
- # Vegan Recipe Chatbot
13
-
14
 
 
15
 
16
  ![Screenshot of Chatbot initial interface](docs/assets/chatbot_init.png)
17
 
@@ -23,10 +22,19 @@ license: unknown
23
  cd lv-recipe-chatbot
24
  ```
25
 
26
- Install Python poetry for dependency management.
 
 
 
 
 
 
 
27
 
28
  ```sh
29
- poetry install
 
 
30
  ```
31
 
32
  Put API secrets in .env
@@ -48,6 +56,18 @@ Then start the Gradio demo.
48
  python app.py
49
  ```
50
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  ## Useful links
52
 
53
  * [Task Matrix (Formerly Visual ChatGPT)](https://github.com/microsoft/TaskMatrix)
 
9
  pinned: false
10
  license: unknown
11
  ---
 
 
12
 
13
+ # Vegan Recipe Chatbot
14
 
15
  ![Screenshot of Chatbot initial interface](docs/assets/chatbot_init.png)
16
 
 
22
  cd lv-recipe-chatbot
23
  ```
24
 
25
+ Make sure to use the version of python specified in `py_version.txt`
26
+ Create a virtual environment.
27
+
28
+ ```sh
29
+ python3 -m venv env
30
+ ```
31
+
32
+ Activate the env and install dependencies.
33
 
34
  ```sh
35
+ source env/bin/activate
36
+ pip install -r requirements.txt
37
+ pip install -r requirements/dev.txt
38
  ```
39
 
40
  Put API secrets in .env
 
56
  python app.py
57
  ```
58
 
59
+ ## Dependencies
60
+
61
+ If a new dependency for devlepment is helpful for developers, add it to `dev.txt`.
62
+ If it is a dependency for the app that is imported in source code, add it to `core.txt`.
63
+ Then run:
64
+
65
+ ```sh
66
+ pipreqs --force
67
+ ```
68
+
69
+ This will update our `requirements.txt` to include the depenency as it should be pinned in the environment.
70
+
71
  ## Useful links
72
 
73
  * [Task Matrix (Formerly Visual ChatGPT)](https://github.com/microsoft/TaskMatrix)
poetry.lock DELETED
The diff for this file is too large to render. See raw diff
 
py_version.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Python 3.10.6
pyproject.toml DELETED
@@ -1,29 +0,0 @@
1
- [tool.poetry]
2
- name = "lv-recipe-chatbot"
3
- version = "0.1.0"
4
- description = "Chatbot for recommending vegan recipes"
5
- authors = ["Evan Lesmez <evanl@animalequality.org>"]
6
- readme = "README.md"
7
- packages = [{ include = "chatbot" }]
8
-
9
- [tool.poetry.dependencies]
10
- python = "^3.8.1"
11
- langchain = "^0.0.145"
12
- openai = "^0.27.4"
13
- gradio = "^3.27.0"
14
- jupyterlab = "^3.6.3"
15
- tqdm = "^4.65.0"
16
- transformers = "^4.28.1"
17
- promptlayer = "^0.1.80"
18
- python-dotenv = "^1.0.0"
19
- wget = "3.2"
20
-
21
- [tool.poetry.group.dev.dependencies]
22
- black = "^23.3.0"
23
- pytest = "^7.3.1"
24
- mypy = "^1.2.0"
25
-
26
-
27
- [build-system]
28
- requires = ["poetry-core"]
29
- build-backend = "poetry.core.masonry.api"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,165 +1,3 @@
1
- aiofiles==22.1.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
2
- aiohttp==3.8.4 ; python_full_version >= "3.8.1" and python_version < "4.0"
3
- aiosignal==1.3.1 ; python_full_version >= "3.8.1" and python_version < "4.0"
4
- aiosqlite==0.19.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
5
- altair==5.0.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
6
- anyio==3.6.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
7
- appnope==0.1.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" and sys_platform == "darwin" or python_full_version >= "3.8.1" and python_full_version < "4.0.0" and platform_system == "Darwin"
8
- argon2-cffi-bindings==21.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
9
- argon2-cffi==21.3.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
10
- arrow==1.2.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
11
- asttokens==2.2.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
12
- async-timeout==4.0.2 ; python_full_version >= "3.8.1" and python_version < "4.0"
13
- attrs==23.1.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
14
- babel==2.12.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
15
- backcall==0.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
16
- beautifulsoup4==4.12.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
17
- bleach==6.0.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
18
- certifi==2023.5.7 ; python_full_version >= "3.8.1" and python_version < "4.0"
19
- cffi==1.15.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
20
- charset-normalizer==3.1.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
21
- click==8.1.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
22
- colorama==0.4.6 ; python_full_version >= "3.8.1" and python_version < "4.0" and platform_system == "Windows" or python_full_version >= "3.8.1" and python_version < "4.0" and sys_platform == "win32"
23
- comm==0.1.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
24
- contourpy==1.0.7 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
25
- cycler==0.11.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
26
- dataclasses-json==0.5.7 ; python_full_version >= "3.8.1" and python_version < "4.0"
27
- debugpy==1.6.7 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
28
- decorator==5.1.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
29
- defusedxml==0.7.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
30
- executing==1.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
31
- fastapi==0.95.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
32
- fastjsonschema==2.16.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
33
- ffmpy==0.3.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
34
- filelock==3.12.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
35
- fonttools==4.39.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
36
- fqdn==1.5.1 ; python_full_version >= "3.8.1" and python_version < "4"
37
- frozenlist==1.3.3 ; python_full_version >= "3.8.1" and python_version < "4.0"
38
- fsspec==2023.5.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
39
- gradio-client==0.2.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
40
- gradio==3.29.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
41
- greenlet==2.0.2 ; python_full_version >= "3.8.1" and platform_machine == "aarch64" and python_version < "4.0" or python_full_version >= "3.8.1" and platform_machine == "ppc64le" and python_version < "4.0" or python_full_version >= "3.8.1" and platform_machine == "x86_64" and python_version < "4.0" or python_full_version >= "3.8.1" and platform_machine == "amd64" and python_version < "4.0" or python_full_version >= "3.8.1" and platform_machine == "AMD64" and python_version < "4.0" or python_full_version >= "3.8.1" and platform_machine == "win32" and python_version < "4.0" or python_full_version >= "3.8.1" and platform_machine == "WIN32" and python_version < "4.0"
42
- h11==0.14.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
43
- httpcore==0.17.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
44
- httpx==0.24.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
45
- huggingface-hub==0.14.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
46
- idna==3.4 ; python_full_version >= "3.8.1" and python_version < "4.0"
47
- importlib-metadata==6.6.0 ; python_full_version >= "3.8.1" and python_version < "3.10"
48
- importlib-resources==5.12.0 ; python_full_version >= "3.8.1" and python_version < "3.10"
49
- ipykernel==6.23.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
50
- ipython-genutils==0.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
51
- ipython==8.12.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
52
- isoduration==20.11.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
53
- jedi==0.18.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
54
- jinja2==3.1.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
55
- json5==0.9.11 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
56
- jsonpointer==2.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
57
- jsonschema==4.17.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
58
- jsonschema[format-nongpl]==4.17.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
59
- jupyter-client==8.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
60
- jupyter-core==5.3.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
61
- jupyter-events==0.6.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
62
- jupyter-server-fileid==0.9.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
63
- jupyter-server-terminals==0.4.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
64
- jupyter-server-ydoc==0.8.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
65
- jupyter-server==2.5.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
66
- jupyter-ydoc==0.2.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
67
- jupyterlab-pygments==0.2.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
68
- jupyterlab-server==2.22.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
69
- jupyterlab==3.6.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
70
- kiwisolver==1.4.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
71
- langchain==0.0.145 ; python_full_version >= "3.8.1" and python_version < "4.0"
72
- linkify-it-py==2.0.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
73
- markdown-it-py==2.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
74
- markdown-it-py[linkify]==2.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
75
- markupsafe==2.1.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
76
- marshmallow-enum==1.5.1 ; python_full_version >= "3.8.1" and python_version < "4.0"
77
- marshmallow==3.19.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
78
- matplotlib-inline==0.1.6 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
79
- matplotlib==3.7.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
80
- mdit-py-plugins==0.3.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
81
- mdurl==0.1.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
82
- mistune==2.0.5 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
83
- multidict==6.0.4 ; python_full_version >= "3.8.1" and python_version < "4.0"
84
- mypy-extensions==1.0.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
85
- nbclassic==1.0.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
86
- nbclient==0.7.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
87
- nbconvert==7.4.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
88
- nbformat==5.8.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
89
- nest-asyncio==1.5.6 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
90
- notebook-shim==0.2.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
91
- notebook==6.5.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
92
- numexpr==2.8.4 ; python_full_version >= "3.8.1" and python_version < "4.0"
93
- numpy==1.24.3 ; python_full_version >= "3.8.1" and python_version < "4.0"
94
- openai==0.27.6 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
95
- openapi-schema-pydantic==1.2.4 ; python_full_version >= "3.8.1" and python_version < "4.0"
96
- orjson==3.8.12 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
97
- packaging==23.1 ; python_full_version >= "3.8.1" and python_version < "4.0"
98
- pandas==2.0.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
99
- pandocfilters==1.5.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
100
- parso==0.8.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
101
- pexpect==4.8.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" and sys_platform != "win32"
102
- pickleshare==0.7.5 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
103
- pillow==9.5.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
104
- pkgutil-resolve-name==1.3.10 ; python_full_version >= "3.8.1" and python_version < "3.9"
105
- platformdirs==3.5.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
106
- prometheus-client==0.16.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
107
- prompt-toolkit==3.0.38 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
108
- promptlayer==0.1.80 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
109
- psutil==5.9.5 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
110
- ptyprocess==0.7.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" and sys_platform != "win32" or python_full_version >= "3.8.1" and python_full_version < "4.0.0" and os_name != "nt"
111
- pure-eval==0.2.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
112
- pycparser==2.21 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
113
- pydantic==1.10.7 ; python_full_version >= "3.8.1" and python_version < "4.0"
114
- pydub==0.25.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
115
- pygments==2.15.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
116
- pyparsing==3.0.9 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
117
- pyrsistent==0.19.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
118
- python-dateutil==2.8.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
119
- python-dotenv==1.0.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
120
- python-json-logger==2.0.7 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
121
- python-multipart==0.0.6 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
122
- pytz==2023.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
123
- pywin32==306 ; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_full_version >= "3.8.1" and python_full_version < "4.0.0"
124
- pywinpty==2.0.10 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" and os_name == "nt"
125
- pyyaml==6.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
126
- pyzmq==25.0.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
127
- regex==2023.5.5 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
128
- requests==2.30.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
129
- rfc3339-validator==0.1.4 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
130
- rfc3986-validator==0.1.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
131
- semantic-version==2.10.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
132
- send2trash==1.8.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
133
- six==1.16.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
134
- sniffio==1.3.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
135
- soupsieve==2.4.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
136
- sqlalchemy==1.4.48 ; python_full_version >= "3.8.1" and python_version < "4.0"
137
- stack-data==0.6.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
138
- starlette==0.26.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
139
- tenacity==8.2.2 ; python_full_version >= "3.8.1" and python_version < "4.0"
140
- terminado==0.17.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
141
- tinycss2==1.2.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
142
- tokenizers==0.13.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
143
- tomli==2.0.1 ; python_full_version >= "3.8.1" and python_version < "3.11"
144
- toolz==0.12.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
145
- tornado==6.3.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
146
- tqdm==4.65.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
147
- traitlets==5.9.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
148
- transformers==4.29.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
149
- typing-extensions==4.5.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
150
- typing-inspect==0.8.0 ; python_full_version >= "3.8.1" and python_version < "4.0"
151
- tzdata==2023.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
152
- uc-micro-py==1.0.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
153
- uri-template==1.2.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
154
- urllib3==2.0.2 ; python_full_version >= "3.8.1" and python_version < "4.0"
155
- uvicorn==0.22.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
156
- wcwidth==0.2.6 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
157
- webcolors==1.13 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
158
- webencodings==0.5.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
159
- websocket-client==1.5.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
160
- websockets==11.0.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
161
- wget==3.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
162
- y-py==0.5.9 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
163
- yarl==1.9.2 ; python_full_version >= "3.8.1" and python_version < "4.0"
164
- ypy-websocket==0.8.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0"
165
- zipp==3.15.0 ; python_full_version >= "3.8.1" and python_version < "3.10"
 
1
+ gradio==3.33.1
2
+ langchain==0.0.191
3
+ python-dotenv==1.0.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements/core.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ langchain
2
+ openai
3
+ gradio
requirements/dev.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ black
2
+ pytest
3
+ python-dotenv
4
+ mypy
5
+ nbdev
6
+ isort
7
+ jupyterlab
8
+ promptlayer
9
+ pipreqs