Skip to content

Commit 9db9e55

Browse files
committed
Conteneurisation & CI/CD
1 parent 154aa50 commit 9db9e55

9 files changed

Lines changed: 64 additions & 18 deletions

File tree

.gradio/certificate.pem

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
3+
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
4+
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
5+
WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
6+
ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
7+
MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc
8+
h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+
9+
0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U
10+
A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW
11+
T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH
12+
B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC
13+
B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv
14+
KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn
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99b21/+jh5Xos1AnX5iItreGCc=
31+
-----END CERTIFICATE-----

Docker-SA

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 080f7ab5c61d7c04e8a43faf7f405a619385bbc4

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ RUN pip install --no-cache-dir -r requirements.txt
2222

2323
# Copier le reste du projet
2424
COPY . .
25-
COPY static ./static
2625

2726
# Exposer le port 7860 (obligatoire pour HF Spaces)
2827
EXPOSE 7860

Gradio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 85120273af3c2585ca91c77d51d0595d17309d8b

__pycache__/main.cpython-312.pyc

5.34 KB
Binary file not shown.
14 Bytes
Binary file not shown.

app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
)
4141

4242
# Serve static files (page HTML de test)
43-
STATIC_DIR = os.path.join(os.path.dirname(__file__), "..", "static")
43+
STATIC_DIR = os.path.join(os.path.dirname(__file__), "../static")
4444
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
4545

4646
@app.get("/", include_in_schema=False)

static/index.html

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,40 @@
11
<!doctype html>
22
<html lang="fr">
3+
34
<head>
45
<meta charset="utf-8" />
56
<meta name="viewport" content="width=device-width, initial-scale=1" />
67
<title>Test Sentiment API</title>
7-
<style>
8-
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; margin: 2rem; max-width: 800px; }
9-
textarea { width: 100%; min-height: 120px; }
10-
button { padding: .6rem 1rem; cursor: pointer; }
11-
.result { margin-top: 1rem; padding: 1rem; border: 1px solid #ddd; border-radius: .5rem; white-space: pre-wrap; }
12-
code { background: #f7f7f7; padding: .2rem .4rem; border-radius: .3rem; }
13-
</style>
8+
<!-- Tailwind CSS CDN -->
9+
<script src="https://cdn.tailwindcss.com"></script>
1410
</head>
15-
<body>
16-
<h1>Test de l'API d'analyse de sentiments</h1>
17-
<p>
18-
Tapez un texte et cliquez sur <b>Analyser</b>. L'API appelle <code>POST /predict</code> et affiche le JSON de réponse.
19-
</p>
2011

21-
<textarea id="text" placeholder="I love this product!"></textarea><br><br>
22-
<button id="btn">Analyser</button>
23-
<div class="result" id="result">Résultat…</div>
12+
<body class="bg-gray-100 min-h-screen flex items-center justify-center">
13+
<div class="max-w-2xl w-full bg-white shadow-md rounded-2xl p-8">
14+
<h1 class="text-2xl font-bold mb-4">Test de l'API pour l'analyse des sentiments</h1>
15+
<p class="text-gray-700 mb-6">
16+
Tapez un texte et cliquez sur <b>Analyser</b>.
17+
<!-- L'API appelle <code class="bg-gray-100 px-1 py-0.5 rounded">POST /predict</code> et affiche le JSON de réponse. -->
18+
</p>
19+
20+
<div class="mb-4">
21+
<label for="text" class="block font-medium text-gray-800 mb-2">Votre texte</label>
22+
<textarea id="text" rows="4" placeholder="I love this product!"
23+
class="w-full border border-gray-300 rounded-lg p-3 focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
24+
</div>
25+
26+
<button id="btn" class="bg-blue-600 text-white px-5 py-2 rounded-lg hover:bg-blue-700 transition">
27+
Analyser
28+
</button>
29+
30+
<div class="mt-6">
31+
<h5 class="text-lg font-semibold">Résultat</h5>
32+
<pre id="result"
33+
class="mt-2 border border-gray-300 rounded-lg bg-gray-50 p-4 text-sm text-gray-800 whitespace-pre-wrap">
34+
Résultat…
35+
</pre>
36+
</div>
37+
</div>
2438

2539
<script>
2640
const btn = document.getElementById('btn');
@@ -44,4 +58,5 @@ <h1>Test de l'API d'analyse de sentiments</h1>
4458
};
4559
</script>
4660
</body>
61+
4762
</html>

tests/test_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from fastapi.testclient import TestClient
2-
from app.main import app
32

43
client = TestClient(app)
54

0 commit comments

Comments
 (0)