Spaces:
Paused
Paused
Update README.md
Browse files
README.md
CHANGED
|
@@ -189,5 +189,49 @@ This project is licensed under the MIT License.
|
|
| 189 |
|
| 190 |
---
|
| 191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
> Built for IndiaAI students at NIELIT Ropar · No brainrot. Just facts. 🌾
|
| 193 |
|
|
|
|
| 189 |
|
| 190 |
---
|
| 191 |
|
| 192 |
+
## ☁️ Deployment Guides
|
| 193 |
+
|
| 194 |
+
This app is designed to be easily deployed to modern cloud platforms. Below are the steps for deploying to Render and Hugging Face Spaces.
|
| 195 |
+
|
| 196 |
+
### 🚀 Deploy on Render
|
| 197 |
+
|
| 198 |
+
Render provides a seamless way to deploy Python web services directly from your GitHub repository.
|
| 199 |
+
|
| 200 |
+
1. Create an account on [Render](https://render.com/) and go to your Dashboard.
|
| 201 |
+
2. Click **New** and select **Web Service**.
|
| 202 |
+
3. Connect your GitHub account and select the `crop-predict` repository.
|
| 203 |
+
4. Configure the service with the following settings:
|
| 204 |
+
* **Runtime:** Python
|
| 205 |
+
* **Build Command:** `pip install -r requirements.txt`
|
| 206 |
+
* **Start Command:** `gunicorn app:app`
|
| 207 |
+
5. **⚠️ Crucial Step:** Scroll down to **Environment Variables**, click **Add Environment Variable**, and add the following:
|
| 208 |
+
* **Key:** `PYTHON_VERSION`
|
| 209 |
+
* **Value:** `3.11.0`
|
| 210 |
+
*(Note: This forces Render to use Python 3.11, allowing it to instantly download pre-compiled `scikit-learn` binaries instead of taking 30+ minutes to build from source).*
|
| 211 |
+
6. Click **Deploy Web Service**. Your app will be live in a few minutes!
|
| 212 |
+
|
| 213 |
+
> **Docs:** Docs on specifying a Python version: https://render.com/docs/python-version
|
| 214 |
+
|
| 215 |
+
### 🤗 Deploy on Hugging Face Spaces
|
| 216 |
+
|
| 217 |
+
Hugging Face Spaces is an excellent platform for hosting machine learning demos using Docker.
|
| 218 |
+
|
| 219 |
+
1. Create an account on [Hugging Face](https://huggingface.co/) and navigate to **Spaces**.
|
| 220 |
+
2. Click **Create new Space**.
|
| 221 |
+
3. Fill in the configuration:
|
| 222 |
+
* **Space name:** `croppredict` (or your preferred name)
|
| 223 |
+
* **License:** MIT
|
| 224 |
+
* **Select the Space SDK:** Choose **Docker** -> **Blank**.
|
| 225 |
+
* **Space hardware:** Free (CPU basic)
|
| 226 |
+
4. Click **Create Space**.
|
| 227 |
+
5. You can now upload your project files directly via the **Files** tab in your browser, or push them using Git. Ensure the following files are included in the root directory:
|
| 228 |
+
* `Dockerfile` (HF uses this to build your environment)
|
| 229 |
+
* `app.py`
|
| 230 |
+
* `requirements.txt`
|
| 231 |
+
* `crop_recommendation_model.joblib`
|
| 232 |
+
* `templates/` and `static/` folders
|
| 233 |
+
6. Once the files are uploaded, Hugging Face will automatically read the `Dockerfile`, build the container, and launch your Flask app!
|
| 234 |
+
|
| 235 |
+
|
| 236 |
> Built for IndiaAI students at NIELIT Ropar · No brainrot. Just facts. 🌾
|
| 237 |
|