fix readme
Browse files
README.md
CHANGED
|
@@ -1,57 +1,42 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
##
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
### Hosting model artifacts
|
| 45 |
-
|
| 46 |
-
- Upload the serialized pipelines to the existing Hugging Face _model_ repo `deropxyz/AC02-ML`:
|
| 47 |
-
```
|
| 48 |
-
hf upload --repo-id deropxyz/AC02-ML AC02-ML/model_pipeline_improved.joblib
|
| 49 |
-
hf upload --repo-id deropxyz/AC02-ML AC02-ML/model_pipeline.joblib
|
| 50 |
-
```
|
| 51 |
-
- `api/main.py` downloads the artifacts at startup using `HF_MODEL_REPO`, `HF_PRIMARY_MODEL`, and `HF_FALLBACK_MODEL` env vars (defaults target `deropxyz/AC02-ML`). If the model repo is private, add `HF_TOKEN` in the Space settings (Variables & secrets).
|
| 52 |
-
- No large binaries are stored inside this repo; the runtime pulls them from the Hub cache.
|
| 53 |
-
|
| 54 |
-
## Keeping the Space Updated
|
| 55 |
-
|
| 56 |
-
- Copy any new code from `AC02-ML` into this folder, commit, and push.
|
| 57 |
-
- When retraining, upload the new model artifact to the Hub model repo and update the env vars if filenames change.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: AC02-ML
|
| 3 |
+
emoji: ⚙️
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
sdk_version: "latest"
|
| 8 |
+
app_file: api/main.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# AC02-ML Predictive Maintenance API
|
| 13 |
+
|
| 14 |
+
This Space deploys a Predictive Maintenance API using FastAPI and Docker.
|
| 15 |
+
|
| 16 |
+
## API Endpoints
|
| 17 |
+
|
| 18 |
+
- **POST `/predict`**: Get maintenance predictions for equipment
|
| 19 |
+
- **POST `/predict_batch`**: Process multiple equipment data points
|
| 20 |
+
- **GET `/docs`**: Interactive API documentation (FastAPI/Swagger)
|
| 21 |
+
- **GET `/health`**: Health check endpoint
|
| 22 |
+
|
| 23 |
+
## Model Information
|
| 24 |
+
|
| 25 |
+
This API uses machine learning models trained for predictive maintenance:
|
| 26 |
+
|
| 27 |
+
- Primary model: Enhanced pipeline with feature engineering
|
| 28 |
+
- Fallback model: Basic model pipeline
|
| 29 |
+
- Models are automatically downloaded from the Hugging Face Hub at startup
|
| 30 |
+
|
| 31 |
+
## Usage
|
| 32 |
+
|
| 33 |
+
Visit the `/docs` endpoint to interact with the API through the Swagger UI, or send POST requests to the prediction endpoints with equipment sensor data.
|
| 34 |
+
|
| 35 |
+
## Technical Details
|
| 36 |
+
|
| 37 |
+
- **Framework**: FastAPI
|
| 38 |
+
- **Deployment**: Docker container
|
| 39 |
+
- **Models**: Hosted on Hugging Face Model Hub
|
| 40 |
+
- **Environment**: Python 3.9+
|
| 41 |
+
|
| 42 |
+
For more information about deployment and setup, please refer to the project documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|