GitHub Actions commited on
Commit
566d4b5
·
1 Parent(s): e48224a

🚀 Auto-deploy from GitHub Actions

Browse files
.github/workflows/deploy.yml CHANGED
@@ -1,10 +1,13 @@
1
- name: Déployer vers Hugging Face Spaces
2
 
3
  on:
4
  push:
5
  branches:
6
  - main
7
 
 
 
 
8
  jobs:
9
  deploy:
10
  runs-on: ubuntu-latest
@@ -23,7 +26,7 @@ jobs:
23
  python -m pip install --upgrade pip
24
  if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25
 
26
- - name: Push to Hugging Face Space
27
  env:
28
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
29
  run: |
@@ -33,5 +36,5 @@ jobs:
33
  rsync -av --exclude '.git' ./ hf_space/
34
  cd hf_space
35
  git add .
36
- git commit -m "🚀 Auto-deploy from GitHub Actions"
37
  git push https://stephmnt:$HF_TOKEN@huggingface.co/spaces/stephmnt/projet_05 main
 
1
+ name: Deploy to Hugging Face Spaces
2
 
3
  on:
4
  push:
5
  branches:
6
  - main
7
 
8
+ permissions:
9
+ contents: write
10
+
11
  jobs:
12
  deploy:
13
  runs-on: ubuntu-latest
 
26
  python -m pip install --upgrade pip
27
  if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28
 
29
+ - name: Deploy to Hugging Face Space
30
  env:
31
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
32
  run: |
 
36
  rsync -av --exclude '.git' ./ hf_space/
37
  cd hf_space
38
  git add .
39
+ git commit -m "🚀 Auto-deploy from GitHub Actions" || echo "No changes to commit"
40
  git push https://stephmnt:$HF_TOKEN@huggingface.co/spaces/stephmnt/projet_05 main
.gitignore CHANGED
@@ -1,2 +1,211 @@
 
1
  *.code-workspace
2
- .venv/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VS_Code
2
  *.code-workspace
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.pyc
7
+ *.py[codz]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py.cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # UV
102
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ #uv.lock
106
+
107
+ # poetry
108
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
110
+ # commonly ignored for libraries.
111
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112
+ #poetry.lock
113
+ #poetry.toml
114
+
115
+ # pdm
116
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
118
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
119
+ #pdm.lock
120
+ #pdm.toml
121
+ .pdm-python
122
+ .pdm-build/
123
+
124
+ # pixi
125
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
126
+ #pixi.lock
127
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
128
+ # in the .venv directory. It is recommended not to include this directory in version control.
129
+ .pixi
130
+
131
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132
+ __pypackages__/
133
+
134
+ # Celery stuff
135
+ celerybeat-schedule
136
+ celerybeat.pid
137
+
138
+ # SageMath parsed files
139
+ *.sage.py
140
+
141
+ # Environments
142
+ .env
143
+ .envrc
144
+ .venv
145
+ env/
146
+ venv/
147
+ ENV/
148
+ env.bak/
149
+ venv.bak/
150
+
151
+ # Spyder project settings
152
+ .spyderproject
153
+ .spyproject
154
+
155
+ # Rope project settings
156
+ .ropeproject
157
+
158
+ # mkdocs documentation
159
+ /site
160
+
161
+ # mypy
162
+ .mypy_cache/
163
+ .dmypy.json
164
+ dmypy.json
165
+
166
+ # Pyre type checker
167
+ .pyre/
168
+
169
+ # pytype static type analyzer
170
+ .pytype/
171
+
172
+ # Cython debug symbols
173
+ cython_debug/
174
+
175
+ # PyCharm
176
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
177
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
178
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
179
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
180
+ #.idea/
181
+
182
+ # Abstra
183
+ # Abstra is an AI-powered process automation framework.
184
+ # Ignore directories containing user credentials, local state, and settings.
185
+ # Learn more at https://abstra.io/docs
186
+ .abstra/
187
+
188
+ # Visual Studio Code
189
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
190
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
191
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
192
+ # you could uncomment the following to ignore the entire vscode folder
193
+ # .vscode/
194
+
195
+ # Ruff stuff:
196
+ .ruff_cache/
197
+
198
+ # PyPI configuration file
199
+ .pypirc
200
+
201
+ # Cursor
202
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
203
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
204
+ # refer to https://docs.cursor.com/context/ignore-files
205
+ .cursorignore
206
+ .cursorindexingignore
207
+
208
+ # Marimo
209
+ marimo/_static/
210
+ marimo/_lsp/
211
+ __marimo__/
README.md CHANGED
@@ -10,3 +10,270 @@ pinned: false
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
13
+
14
+ <!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->
15
+ <a id="readme-top"></a>
16
+ <!--
17
+ *** Thanks for checking out the Best-README-Template. If you have a suggestion
18
+ *** that would make this better, please fork the repo and create a pull request
19
+ *** or simply open an issue with the tag "enhancement".
20
+ *** Don't forget to give the project a star!
21
+ *** Thanks again! Now go create something AMAZING! :D
22
+ -->
23
+
24
+
25
+
26
+ <!-- PROJECT SHIELDS -->
27
+ <!--
28
+ *** I'm using markdown "reference style" links for readability.
29
+ *** Reference links are enclosed in brackets [ ] instead of parentheses ( ).
30
+ *** See the bottom of this document for the declaration of the reference variables
31
+ *** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
32
+ *** https://www.markdownguide.org/basic-syntax/#reference-style-links
33
+ -->
34
+ [![Contributors][contributors-shield]][contributors-url]
35
+ [![Forks][forks-shield]][forks-url]
36
+ [![Stargazers][stars-shield]][stars-url]
37
+ [![Issues][issues-shield]][issues-url]
38
+ [![project_license][license-shield]][license-url]
39
+ [![LinkedIn][linkedin-shield]][linkedin-url]
40
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/:user/:repo/:workflow)
41
+
42
+
43
+
44
+ <!-- PROJECT LOGO -->
45
+ <br />
46
+ <div align="center">
47
+ <a href="https://github.com/github_username/repo_name">
48
+ <img src="images/logo.png" alt="Logo" width="80" height="80">
49
+ </a>
50
+
51
+ <h3 align="center">project_title</h3>
52
+
53
+ <p align="center">
54
+ project_description
55
+ <br />
56
+ <a href="https://github.com/github_username/repo_name"><strong>Explore the docs »</strong></a>
57
+ <br />
58
+ <br />
59
+ <a href="https://github.com/github_username/repo_name">View Demo</a>
60
+ &middot;
61
+ <a href="https://github.com/github_username/repo_name/issues/new?labels=bug&template=bug-report---.md">Report Bug</a>
62
+ &middot;
63
+ <a href="https://github.com/github_username/repo_name/issues/new?labels=enhancement&template=feature-request---.md">Request Feature</a>
64
+ </p>
65
+ </div>
66
+
67
+
68
+
69
+ <!-- TABLE OF CONTENTS -->
70
+ <details>
71
+ <summary>Table of Contents</summary>
72
+ <ol>
73
+ <li>
74
+ <a href="#about-the-project">About The Project</a>
75
+ <ul>
76
+ <li><a href="#built-with">Built With</a></li>
77
+ </ul>
78
+ </li>
79
+ <li>
80
+ <a href="#getting-started">Getting Started</a>
81
+ <ul>
82
+ <li><a href="#prerequisites">Prerequisites</a></li>
83
+ <li><a href="#installation">Installation</a></li>
84
+ </ul>
85
+ </li>
86
+ <li><a href="#usage">Usage</a></li>
87
+ <li><a href="#roadmap">Roadmap</a></li>
88
+ <li><a href="#contributing">Contributing</a></li>
89
+ <li><a href="#license">License</a></li>
90
+ <li><a href="#contact">Contact</a></li>
91
+ <li><a href="#acknowledgments">Acknowledgments</a></li>
92
+ </ol>
93
+ </details>
94
+
95
+
96
+
97
+ <!-- ABOUT THE PROJECT -->
98
+ ## About The Project
99
+
100
+ [![Product Name Screen Shot][product-screenshot]](https://example.com)
101
+
102
+ Here's a blank template to get started. To avoid retyping too much info, do a search and replace with your text editor for the following: `github_username`, `repo_name`, `twitter_handle`, `linkedin_username`, `email_client`, `email`, `project_title`, `project_description`, `project_license`
103
+
104
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
105
+
106
+
107
+
108
+ ### Built With
109
+
110
+ * [![Python][Python]][Python-url]
111
+ * [![SQL][SQL]][SQL-url]
112
+
113
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
114
+
115
+
116
+
117
+ <!-- GETTING STARTED -->
118
+ ## Getting Started
119
+
120
+ This is an example of how you may give instructions on setting up your project locally.
121
+ To get a local copy up and running follow these simple example steps.
122
+
123
+ ### Prerequisites
124
+
125
+ This is an example of how to list things you need to use the software and how to install them.
126
+ * npm
127
+ ```sh
128
+ npm install npm@latest -g
129
+ ```
130
+
131
+ ### Installation
132
+
133
+ pip install -r requirements.txt
134
+ uvicorn app.main:app --reload
135
+
136
+ 1. Get a free API Key at [https://example.com](https://example.com)
137
+ 2. Clone the repo
138
+ ```sh
139
+ git clone https://github.com/github_username/repo_name.git
140
+ ```
141
+ 3. Install NPM packages
142
+ ```sh
143
+ npm install
144
+ ```
145
+ 4. Enter your API in `config.js`
146
+ ```js
147
+ const API_KEY = 'ENTER YOUR API';
148
+ ```
149
+ 5. Change git remote url to avoid accidental pushes to base project
150
+ ```sh
151
+ git remote set-url origin github_username/repo_name
152
+ git remote -v # confirm the changes
153
+ ```
154
+
155
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
156
+
157
+
158
+
159
+ <!-- USAGE EXAMPLES -->
160
+ ## Usage
161
+
162
+ Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
163
+
164
+ _For more examples, please refer to the [Documentation](https://example.com)_
165
+
166
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
167
+
168
+
169
+
170
+ <!-- ROADMAP -->
171
+ ## Roadmap
172
+
173
+ - [ ] Feature 1
174
+ - [ ] Feature 2
175
+ - [ ] Feature 3
176
+ - [ ] Nested Feature
177
+
178
+ See the [open issues](https://github.com/github_username/repo_name/issues) for a full list of proposed features (and known issues).
179
+
180
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
181
+
182
+
183
+
184
+ <!-- CONTRIBUTING -->
185
+ ## Contributing
186
+
187
+ Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
188
+
189
+ If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
190
+ Don't forget to give the project a star! Thanks again!
191
+
192
+ 1. Fork the Project
193
+ 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
194
+ 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
195
+ 4. Push to the Branch (`git push origin feature/AmazingFeature`)
196
+ 5. Open a Pull Request
197
+
198
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
199
+
200
+ ### Top contributors:
201
+
202
+ <a href="https://github.com/github_username/repo_name/graphs/contributors">
203
+ <img src="https://contrib.rocks/image?repo=github_username/repo_name" alt="contrib.rocks image" />
204
+ </a>
205
+
206
+
207
+
208
+ <!-- LICENSE -->
209
+ ## License
210
+
211
+ Distributed under the project_license. See `LICENSE.txt` for more information.
212
+
213
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
214
+
215
+
216
+
217
+ <!-- CONTACT -->
218
+ ## Contact
219
+
220
+ Your Name - [@twitter_handle](https://twitter.com/twitter_handle) - email@email_client.com
221
+
222
+ Project Link: [https://github.com/github_username/repo_name](https://github.com/github_username/repo_name)
223
+
224
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
225
+
226
+
227
+
228
+ <!-- ACKNOWLEDGMENTS -->
229
+ ## Acknowledgments
230
+
231
+ * []()
232
+ * []()
233
+ * []()
234
+
235
+ <p align="right">(<a href="#readme-top">back to top</a>)</p>
236
+
237
+
238
+
239
+ <!-- MARKDOWN LINKS & IMAGES -->
240
+ <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
241
+ [contributors-shield]: https://img.shields.io/github/contributors/github_username/repo_name.svg?style=for-the-badge
242
+ [contributors-url]: https://github.com/github_username/repo_name/graphs/contributors
243
+ [forks-shield]: https://img.shields.io/github/forks/github_username/repo_name.svg?style=for-the-badge
244
+ [forks-url]: https://github.com/github_username/repo_name/network/members
245
+ [stars-shield]: https://img.shields.io/github/stars/github_username/repo_name.svg?style=for-the-badge
246
+ [stars-url]: https://github.com/github_username/repo_name/stargazers
247
+ [issues-shield]: https://img.shields.io/github/issues/github_username/repo_name.svg?style=for-the-badge
248
+ [issues-url]: https://github.com/github_username/repo_name/issues
249
+ [license-shield]: https://img.shields.io/github/license/github_username/repo_name.svg?style=for-the-badge
250
+ [license-url]: https://github.com/github_username/repo_name/blob/master/LICENSE.txt
251
+ [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
252
+ [linkedin-url]: https://linkedin.com/in/linkedin_username
253
+ [product-screenshot]: images/screenshot.png
254
+ [Noobie]: https://img.shields.io/badge/Data%20Science%20for%20Beginners-84CC16?style=for-the-badge&labelColor=E5E7EB&color=84CC16
255
+ <!-- Shields.io badges. You can a comprehensive list with many more badges at: https://github.com/inttter/md-badges -->
256
+ [Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
257
+ [Next-url]: https://nextjs.org/
258
+ [React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
259
+ [React-url]: https://reactjs.org/
260
+ [Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
261
+ [Vue-url]: https://vuejs.org/
262
+ [Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white
263
+ [Angular-url]: https://angular.io/
264
+ [Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00
265
+ [Svelte-url]: https://svelte.dev/
266
+ [Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white
267
+ [Laravel-url]: https://laravel.com
268
+ [Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white
269
+ [Bootstrap-url]: https://getbootstrap.com
270
+ [JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white
271
+ [JQuery-url]: https://jquery.com
272
+ <!-- TODO: -->
273
+ [![Postgres](https://img.shields.io/badge/Postgres-%23316192.svg?logo=postgresql&logoColor=white)](#)
274
+ [![Python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=fff)](#)
275
+ [![Sphinx](https://img.shields.io/badge/Sphinx-000?logo=sphinx&logoColor=fff)](#)
276
+ [![MkDocs](https://img.shields.io/badge/MkDocs-526CFE?logo=materialformkdocs&logoColor=fff)](#)
277
+ [![NumPy](https://img.shields.io/badge/NumPy-4DABCF?logo=numpy&logoColor=fff)](#)
278
+ [![Pandas](https://img.shields.io/badge/Pandas-150458?logo=pandas&logoColor=fff)](#)
279
+ [![Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack&logoColor=fff)](#)[text](../projet_04/.gitignore)
app/__init__.py ADDED
File without changes
app/main.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet(name):
4
+ return "Hello " + name + "!!"
5
+
6
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
+ demo.launch()
hf_space/.github/workflows/deploy.yml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Déployer vers Hugging Face Spaces
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout repository
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Setup Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.10"
20
+
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25
+
26
+ - name: Push to Hugging Face Space
27
+ env:
28
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
29
+ run: |
30
+ git config --global user.email "actions@github.com"
31
+ git config --global user.name "GitHub Actions"
32
+ git clone https://huggingface.co/spaces/stephmnt/projet_05 hf_space
33
+ rsync -av --exclude '.git' ./ hf_space/
34
+ cd hf_space
35
+ git add .
36
+ git commit -m "🚀 Auto-deploy from GitHub Actions"
37
+ git push https://stephmnt:$HF_TOKEN@huggingface.co/spaces/stephmnt/projet_05 main
hf_space/hf_space/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
hf_space/hf_space/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *.code-workspace
2
+ .venv/
hf_space/hf_space/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Projet 05
3
+ emoji: 👀
4
+ colorFrom: indigo
5
+ colorTo: green
6
+ sdk: gradio
7
+ sdk_version: 5.49.1
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
hf_space/hf_space/app.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet(name):
4
+ return "Hello " + name + "!!"
5
+
6
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
+ demo.launch()
tests/test_app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pytest
2
+ from app.main import greet
3
+
4
+ def test_greet_returns_string():
5
+ """Vérifie que la fonction retourne bien une chaîne de caractères."""
6
+ result = greet("Alice")
7
+ assert isinstance(result, str), "Le résultat doit être une chaîne de caractères."
8
+
9
+ def test_greet_output_content():
10
+ """Vérifie que la fonction génère la phrase attendue."""
11
+ result = greet("Bob")
12
+ assert result == "Hello Bob!!", f"Résultat inattendu : {result}"
13
+
14
+ def test_greet_with_empty_string():
15
+ """Vérifie le comportement si l’entrée est vide."""
16
+ result = greet("")
17
+ assert result == "Hello !!", "Le résultat doit gérer les entrées vides."