Delete README.md
Browse files
README.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: PhishWatch Proxy
|
| 3 |
-
emoji: 🛡️
|
| 4 |
-
sdk: docker
|
| 5 |
-
---
|
| 6 |
-
|
| 7 |
-
# Hugging Face Space - Phishing Text Classifier (Docker + FastAPI)
|
| 8 |
-
|
| 9 |
-
This Space exposes two endpoints so the Flutter app can call them reliably:
|
| 10 |
-
|
| 11 |
-
- `/predict` for text/email/SMS classification via Transformers
|
| 12 |
-
- `/predict-url` for URL classification via your scikit-learn Random Forest model
|
| 13 |
-
|
| 14 |
-
## Files
|
| 15 |
-
- Dockerfile - builds a small FastAPI server image
|
| 16 |
-
- app.py - FastAPI app that loads the model and returns `{ label, score }`.
|
| 17 |
-
- requirements.txt - Python dependencies.
|
| 18 |
-
|
| 19 |
-
## How to deploy
|
| 20 |
-
1. Create a new Space on Hugging Face (type: Docker).
|
| 21 |
-
2. Upload the contents of this `hf_space/` folder to the Space root (including Dockerfile).
|
| 22 |
-
3. In Space Settings → Variables, add:
|
| 23 |
-
- MODEL_ID = Perth0603/phishing-email-mobilebert
|
| 24 |
-
- URL_REPO = Perth0603/Random-Forest-Model-for-PhishingDetection
|
| 25 |
-
- URL_FILENAME = url_rf_model.joblib (set to your artifact filename)
|
| 26 |
-
4. Wait for the Space to build and become green. Test:
|
| 27 |
-
- GET `/` should return `{ status: ok, model: ... }`
|
| 28 |
-
- POST `/predict` with `{ "inputs": "Win an iPhone! Click here" }`
|
| 29 |
-
- POST `/predict-url` with `{ "url": "https://example.com/login" }`
|
| 30 |
-
|
| 31 |
-
## Flutter app config
|
| 32 |
-
Set the Space URL in your env file so the app targets the Space instead of the Hosted Inference API:
|
| 33 |
-
|
| 34 |
-
```
|
| 35 |
-
{"HF_SPACE_URL":"https://<your-space>.hf.space"}
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
Run the app:
|
| 39 |
-
```
|
| 40 |
-
flutter run --dart-define-from-file=hf.env.json
|
| 41 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|