Spaces:
Sleeping
Sleeping
Changed endpoint variable logic to base url variable logic.
Browse files- README.md +7 -1
- src/app.py +1 -1
README.md
CHANGED
|
@@ -45,10 +45,16 @@ To set up and run this project, ensure the following software and tools are inst
|
|
| 45 |
```
|
| 46 |
|
| 47 |
- **Backend server**: This project is the frontend component only. Before proceeding, ensure you've deployed the backend server:
|
|
|
|
| 48 |
1. **Deploy the backend:**
|
| 49 |
- Implementation β [blasisd/musheff-api](https://huggingface.co/spaces/blasisd/musheff-api/tree/main).
|
| 50 |
2. **Configure environment variable:**
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
### Local Development and Testing
|
| 54 |
|
|
|
|
| 45 |
```
|
| 46 |
|
| 47 |
- **Backend server**: This project is the frontend component only. Before proceeding, ensure you've deployed the backend server:
|
| 48 |
+
|
| 49 |
1. **Deploy the backend:**
|
| 50 |
- Implementation β [blasisd/musheff-api](https://huggingface.co/spaces/blasisd/musheff-api/tree/main).
|
| 51 |
2. **Configure environment variable:**
|
| 52 |
+
|
| 53 |
+
- Set `MUSHEFF_API_BASE_URL` variable in your environment to your backend's root URL:
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
MUSHEFF_API_BASE_URL="https://your-backend-server.com" # No trailing slash!
|
| 57 |
+
```
|
| 58 |
|
| 59 |
### Local Development and Testing
|
| 60 |
|
src/app.py
CHANGED
|
@@ -10,7 +10,7 @@ from dotenv import load_dotenv
|
|
| 10 |
load_dotenv()
|
| 11 |
|
| 12 |
|
| 13 |
-
API_ENDPOINT = os.getenv("
|
| 14 |
|
| 15 |
|
| 16 |
def classify_image(img_path: str) -> tuple[dict[str, Any]]:
|
|
|
|
| 10 |
load_dotenv()
|
| 11 |
|
| 12 |
|
| 13 |
+
API_ENDPOINT = f"{os.getenv('MUSHEFF_API_BASE_URL')}/classify"
|
| 14 |
|
| 15 |
|
| 16 |
def classify_image(img_path: str) -> tuple[dict[str, Any]]:
|