Jan Kirenz commited on
Commit
be04835
1 Parent(s): 04a5a41

update with uv

Browse files
Files changed (5) hide show
  1. README.md +55 -33
  2. pyproject.toml +12 -0
  3. requirements.in +5 -0
  4. requirements.txt +144 -2
  5. uv.yml +0 -8
README.md CHANGED
@@ -11,63 +11,85 @@ license: apache-2.0
11
  short_description: Interactive Marketing Text Generator
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
15
 
16
- ## Configuration
17
 
18
- The project is configured to use `uv` with the following `uv.yml` file:
19
-
20
- ```yaml
21
- name: marketing-text-generator
22
- dependencies:
23
- - python=3.10
24
- - pip:
25
- - streamlit
26
- - transformers
27
- scripts:
28
- start: streamlit run app.py
29
  ```
30
 
31
- ## Setup and Usage with `uv`
32
-
33
- To manage this project with `uv`, follow these steps:
34
 
35
- ### Prerequisites
36
 
37
- Ensure you have `uv` installed. If not, you can install it using pip:
38
 
39
  ```sh
40
- pip install uv
41
  ```
42
 
43
- ### Initializing the `uv` Environment
44
 
45
- 1. **Initialize the `uv` environment**: Run the following command to set up the environment based on the `uv.yml` configuration:
46
 
47
  ```sh
48
- uv start
49
  ```
 
 
 
 
50
 
51
- 2. **Activate the `uv` environment**: Use the following command to activate the environment:
 
 
 
 
 
 
 
52
 
 
53
  ```sh
54
- uv activate
55
  ```
56
 
57
- ### Running the Streamlit App
58
 
59
- Once the environment is set up and activated, you can start the Streamlit app using the defined script:
 
 
60
 
61
  ```sh
62
- uv run start
63
  ```
64
 
65
- This command will launch the Streamlit app, and you can access it in your web browser.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
- ### Notes
 
 
68
 
69
- - The first time you run the app, it may take a while to load as it downloads and sets up the necessary dependencies.
70
- - Ensure all required fields in the form are filled out before generating the marketing text.
71
- - Review and edit the generated texts as needed before using them.
72
 
73
- For more information on `uv`, refer to the [official documentation](https://github.com/iterative/uv).
 
11
  short_description: Interactive Marketing Text Generator
12
  ---
13
 
14
+ ## Konfiguration und Abhängigkeiten
15
 
16
+ Das Projekt nutzt `uv` als modernen Python-Paketmanager. Die Abhängigkeiten werden in einer `requirements.in`-Datei definiert:
17
 
18
+ ```txt
19
+ # requirements.in
20
+ streamlit>=1.40.2
21
+ transformers
22
+ python-dotenv
 
 
 
 
 
 
23
  ```
24
 
25
+ ## Setup und Verwendung mit `uv`
 
 
26
 
27
+ ### Voraussetzungen
28
 
29
+ Vor dem Start muss `uv` im System verfügbar sein. Installation über pip:
30
 
31
  ```sh
32
+ pip3 install uv
33
  ```
34
 
35
+ ### Projekt-Setup
36
 
37
+ 1. **Virtuelle Umgebung erstellen und aktivieren**:
38
 
39
  ```sh
40
+ uv venv --python 3.11
41
  ```
42
+
43
+ Umgebung aktivieren:
44
+
45
+ Unter Linux/macOS
46
 
47
+ ```sh
48
+ source .venv/bin/activate
49
+ ```
50
+
51
+ Unter Windows
52
+ ```sh
53
+ .venv\Scripts\activate
54
+ ```
55
 
56
+ 2. **Abhängigkeiten installieren**:
57
  ```sh
58
+ uv pip install -r requirements.in
59
  ```
60
 
61
+ Dieser Befehl installiert alle benötigten Pakete in der virtuellen Umgebung.
62
 
63
+ ### Anwendung starten
64
+
65
+ Nach erfolgreichem Setup lässt sich die Streamlit-Anwendung wie folgt starten:
66
 
67
  ```sh
68
+ streamlit run app.py
69
  ```
70
 
71
+ <!-->
72
+
73
+ ### Entwicklungshinweise
74
+
75
+ - **Abhängigkeiten aktualisieren**: Aktualisierung der Abhängigkeiten durch:
76
+ ```sh
77
+ uv pip compile requirements.in -o requirements.txt
78
+ uv pip install -r requirements.txt
79
+ ```
80
+
81
+ - **Neue Abhängigkeiten hinzufügen**:
82
+ 1. Paket zur `requirements.in` hinzufügen
83
+ 2. Compile-Befehl ausführen
84
+ 3. Aktualisierte Abhängigkeiten installieren
85
+
86
+ -->
87
+
88
+ ### Wichtige Hinweise
89
 
90
+ - Die erste Ausführung kann mehr Zeit in Anspruch nehmen, da alle Abhängigkeiten heruntergeladen und konfiguriert werden müssen.
91
+ - Vor der Textgenerierung sollten alle erforderlichen Formularfelder ausgefüllt sein.
92
+ - Der generierte Text sollte vor der Verwendung überprüft und bei Bedarf angepasst werden.
93
 
94
+ Weitere Informationen zu `uv` finden sich in der [offiziellen Dokumentation](https://github.com/astral-sh/uv).
 
 
95
 
 
pyproject.toml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.uv]
2
+ name = "marketing-text-generator"
3
+ version = "0.1.0"
4
+ description = "Ein Projekt für Marketing-Text-Generierung"
5
+
6
+ [tool.uv.dependencies]
7
+ python = "3.11"
8
+ streamlit = "*"
9
+ transformers = "*"
10
+
11
+ [tool.uv.scripts]
12
+ start = "streamlit run app.py"
requirements.in ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # requirements.in
2
+ streamlit>=1.40.2
3
+ transformers
4
+ torch
5
+ python-dotenv
requirements.txt CHANGED
@@ -1,3 +1,145 @@
1
- streamlit==1.29.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  transformers==4.35.2
3
- torch==2.1.1
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv pip compile requirements.in -o requirements.txt
3
+ altair==5.5.0
4
+ # via streamlit
5
+ attrs==24.2.0
6
+ # via
7
+ # jsonschema
8
+ # referencing
9
+ blinker==1.9.0
10
+ # via streamlit
11
+ cachetools==5.5.0
12
+ # via streamlit
13
+ certifi==2024.8.30
14
+ # via requests
15
+ charset-normalizer==3.4.0
16
+ # via requests
17
+ click==8.1.7
18
+ # via streamlit
19
+ filelock==3.16.1
20
+ # via
21
+ # huggingface-hub
22
+ # torch
23
+ # transformers
24
+ fsspec==2024.10.0
25
+ # via
26
+ # huggingface-hub
27
+ # torch
28
+ gitdb==4.0.11
29
+ # via gitpython
30
+ gitpython==3.1.43
31
+ # via streamlit
32
+ huggingface-hub==0.26.5
33
+ # via
34
+ # tokenizers
35
+ # transformers
36
+ idna==3.10
37
+ # via requests
38
+ jinja2==3.1.4
39
+ # via
40
+ # altair
41
+ # pydeck
42
+ # torch
43
+ jsonschema==4.23.0
44
+ # via altair
45
+ jsonschema-specifications==2024.10.1
46
+ # via jsonschema
47
+ markdown-it-py==3.0.0
48
+ # via rich
49
+ markupsafe==3.0.2
50
+ # via jinja2
51
+ mdurl==0.1.2
52
+ # via markdown-it-py
53
+ mpmath==1.3.0
54
+ # via sympy
55
+ narwhals==1.16.0
56
+ # via altair
57
+ networkx==3.4.2
58
+ # via torch
59
+ numpy==2.2.0
60
+ # via
61
+ # pandas
62
+ # pydeck
63
+ # streamlit
64
+ # transformers
65
+ packaging==24.2
66
+ # via
67
+ # altair
68
+ # huggingface-hub
69
+ # streamlit
70
+ # transformers
71
+ pandas==2.2.3
72
+ # via streamlit
73
+ pillow==11.0.0
74
+ # via streamlit
75
+ protobuf==5.29.1
76
+ # via streamlit
77
+ pyarrow==18.1.0
78
+ # via streamlit
79
+ pydeck==0.9.1
80
+ # via streamlit
81
+ pygments==2.18.0
82
+ # via rich
83
+ python-dateutil==2.9.0.post0
84
+ # via pandas
85
+ python-dotenv==1.0.1
86
+ # via -r requirements.in
87
+ pytz==2024.2
88
+ # via pandas
89
+ pyyaml==6.0.2
90
+ # via
91
+ # huggingface-hub
92
+ # transformers
93
+ referencing==0.35.1
94
+ # via
95
+ # jsonschema
96
+ # jsonschema-specifications
97
+ regex==2024.11.6
98
+ # via transformers
99
+ requests==2.32.3
100
+ # via
101
+ # huggingface-hub
102
+ # streamlit
103
+ # transformers
104
+ rich==13.9.4
105
+ # via streamlit
106
+ rpds-py==0.22.3
107
+ # via
108
+ # jsonschema
109
+ # referencing
110
+ safetensors==0.4.5
111
+ # via transformers
112
+ six==1.17.0
113
+ # via python-dateutil
114
+ smmap==5.0.1
115
+ # via gitdb
116
+ streamlit==1.40.2
117
+ # via -r requirements.in
118
+ sympy==1.13.3
119
+ # via torch
120
+ tenacity==9.0.0
121
+ # via streamlit
122
+ tokenizers==0.15.2
123
+ # via transformers
124
+ toml==0.10.2
125
+ # via streamlit
126
+ torch==2.1.1
127
+ # via -r requirements.in
128
+ tornado==6.4.2
129
+ # via streamlit
130
+ tqdm==4.67.1
131
+ # via
132
+ # huggingface-hub
133
+ # transformers
134
  transformers==4.35.2
135
+ # via -r requirements.in
136
+ typing-extensions==4.12.2
137
+ # via
138
+ # altair
139
+ # huggingface-hub
140
+ # streamlit
141
+ # torch
142
+ tzdata==2024.2
143
+ # via pandas
144
+ urllib3==2.2.3
145
+ # via requests
uv.yml DELETED
@@ -1,8 +0,0 @@
1
- name: marketing-text-generator
2
- dependencies:
3
- - python=3.11
4
- - pip:
5
- - streamlit
6
- - transformers
7
- scripts:
8
- start: streamlit run app.py