Spaces:
Build error
Build error
Tobias Geisler commited on
Commit ·
50897a8
1
Parent(s): e7fd91f
downgrading gradio to avoid continuous svelte tab warning
Browse files- README_DEV.md +3 -46
- app.py +1 -0
- requirements.txt +3 -3
README_DEV.md
CHANGED
|
@@ -81,51 +81,8 @@ To automatically create and update a requirements.txt file for your Python appli
|
|
| 81 |
|
| 82 |
# Updating the requirements.txt
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
1. Install pipreqs:
|
| 89 |
-
```bash
|
| 90 |
-
pip install pipreqs
|
| 91 |
-
```
|
| 92 |
-
2. Navigate to your project directory.
|
| 93 |
-
3. Run pipreqs:
|
| 94 |
-
```bash
|
| 95 |
-
pipreqs .
|
| 96 |
-
```
|
| 97 |
-
|
| 98 |
-
Pipreqs will scan your project, identify the imports, and create a requirements.txt file with only the packages your project actually uses[4][8].
|
| 99 |
-
|
| 100 |
-
## **TODO Automating with GitHub Actions**
|
| 101 |
-
|
| 102 |
-
For projects hosted on GitHub, you can automate the process using GitHub Actions:
|
| 103 |
-
|
| 104 |
-
1. Create a workflow file (e.g., `.github/workflows/update-requirements.yml`).
|
| 105 |
-
2. Use an action like `timmypidashev/auto-pipreqs-cpy@master` to automatically generate the requirements.txt file[5].
|
| 106 |
-
|
| 107 |
-
## **Best Practices**
|
| 108 |
-
|
| 109 |
-
1. **Use virtual environments**: This ensures your requirements.txt only includes project-specific dependencies[4].
|
| 110 |
-
2. **Specify versions**: Use `==` to pin exact versions for reproducibility[4].
|
| 111 |
-
3. **Update regularly**: Keep your requirements.txt up to date as you add or remove dependencies[4].
|
| 112 |
-
4. **Review generated files**: Always review automatically generated requirements.txt files to ensure they're accurate and complete[6].
|
| 113 |
|
| 114 |
-
By following these methods and best practices, you can efficiently manage your Python project's dependencies and ensure consistency across different environments.
|
| 115 |
|
| 116 |
-
Citations:
|
| 117 |
-
[1] https://stackoverflow.com/questions/31684375/automatically-create-file-requirements-txt
|
| 118 |
-
[2] https://www.mend.io/free-developer-tools/a/community/software-dependencies/how-can-i-automatically-generate-and-update-a-requirements-txt-file-from-a-pipfile-using-pipenv/
|
| 119 |
-
[3] https://stackoverflow.com/questions/24764549/upgrade-python-packages-from-requirements-txt-using-pip-command
|
| 120 |
-
[4] https://www.squash.io/how-to-automatically-create-requirementstxt-in-python/
|
| 121 |
-
[5] https://github.com/marketplace/actions/automatic-requirements-txt-generation-for-python-projects
|
| 122 |
-
[6] https://pynwb.readthedocs.io/en/stable/update_requirements.html
|
| 123 |
-
[7] https://www.geeksforgeeks.org/how-to-create-requirements-txt-file-in-python/
|
| 124 |
-
[8] https://www.youtube.com/watch?v=0ZeoruSobc4
|
| 125 |
-
[9] https://www.paleblueapps.com/rockandnull/python-update-requirements-txt/
|
| 126 |
-
[10] https://www.scaler.com/topics/how-to-create-requirements-txt-python/
|
| 127 |
-
[11] https://learn.microsoft.com/en-us/visualstudio/python/managing-required-packages-with-requirements-txt?view=vs-2022
|
| 128 |
-
[12] https://www.jetbrains.com/help/pycharm/managing-dependencies.html
|
| 129 |
-
[13] https://note.nkmk.me/en/python-pip-install-requirements/
|
| 130 |
-
[14] https://www.freecodecamp.org/news/python-requirementstxt-explained/
|
| 131 |
-
[15] https://learnpython.com/blog/python-requirements-file/
|
|
|
|
| 81 |
|
| 82 |
# Updating the requirements.txt
|
| 83 |
|
| 84 |
+
```bash
|
| 85 |
+
pip freeze > requirements.txt
|
| 86 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
|
|
|
| 88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -47,6 +47,7 @@ def create_app():
|
|
| 47 |
)
|
| 48 |
|
| 49 |
# Add event listener to automatically load newly created chatbot
|
|
|
|
| 50 |
create_tab["chatbot_id_output"].change(
|
| 51 |
fn=load_chatbot,
|
| 52 |
inputs=[create_tab["chatbot_id_output"]],
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
# Add event listener to automatically load newly created chatbot
|
| 50 |
+
|
| 51 |
create_tab["chatbot_id_output"].change(
|
| 52 |
fn=load_chatbot,
|
| 53 |
inputs=[create_tab["chatbot_id_output"]],
|
requirements.txt
CHANGED
|
@@ -28,8 +28,8 @@ ffmpy==0.3.2
|
|
| 28 |
filelock==3.15.4
|
| 29 |
fonttools==4.53.1
|
| 30 |
fsspec==2024.6.1
|
| 31 |
-
gradio==4.
|
| 32 |
-
gradio_client==
|
| 33 |
greenlet==3.0.3
|
| 34 |
h11==0.14.0
|
| 35 |
httpcore==1.0.5
|
|
@@ -56,7 +56,7 @@ mistune==3.0.2
|
|
| 56 |
nbclient==0.10.0
|
| 57 |
nbconvert==7.16.4
|
| 58 |
nbformat==5.10.4
|
| 59 |
-
numpy==
|
| 60 |
openai==1.35.14
|
| 61 |
orjson==3.10.6
|
| 62 |
packaging==24.1
|
|
|
|
| 28 |
filelock==3.15.4
|
| 29 |
fonttools==4.53.1
|
| 30 |
fsspec==2024.6.1
|
| 31 |
+
gradio==4.33.0
|
| 32 |
+
gradio_client==0.17.0
|
| 33 |
greenlet==3.0.3
|
| 34 |
h11==0.14.0
|
| 35 |
httpcore==1.0.5
|
|
|
|
| 56 |
nbclient==0.10.0
|
| 57 |
nbconvert==7.16.4
|
| 58 |
nbformat==5.10.4
|
| 59 |
+
numpy==1.26.4
|
| 60 |
openai==1.35.14
|
| 61 |
orjson==3.10.6
|
| 62 |
packaging==24.1
|