Debashis commited on
Commit Β·
d5dc3a0
1
Parent(s): 6b23e48
Add HF Spaces configuration and update README with proper setup instructions
Browse files- README.md +28 -3
- spaces.yaml +6 -0
README.md
CHANGED
|
@@ -63,9 +63,19 @@ pytest --cov=src tests/ # With coverage
|
|
| 63 |
## Deployment
|
| 64 |
|
| 65 |
### Hugging Face Spaces (Recommended)
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
### Local Deployment
|
| 71 |
```bash
|
|
@@ -84,6 +94,21 @@ python src/app.py
|
|
| 84 |
- `LLM_MODEL`: Model name (e.g., `gpt-4-turbo`, defaults provided per provider)
|
| 85 |
- `DEBUG`: Set to `true` for verbose logging
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
## Example Security Incidents
|
| 88 |
|
| 89 |
Try these in the app:
|
|
|
|
| 63 |
## Deployment
|
| 64 |
|
| 65 |
### Hugging Face Spaces (Recommended)
|
| 66 |
+
The app is automatically deployed! Just visit:
|
| 67 |
+
π **https://huggingface.co/spaces/debashis2007/SecurityIncidentAnalyzer**
|
| 68 |
+
|
| 69 |
+
HF Spaces detects and auto-configures:
|
| 70 |
+
- β
`spaces.yaml` β Gradio app configuration
|
| 71 |
+
- β
`Procfile` β Launch command
|
| 72 |
+
- β
`requirements.txt` β Dependencies
|
| 73 |
+
|
| 74 |
+
**Optional: Add OpenAI API Key to HF Spaces**
|
| 75 |
+
1. Go to Space Settings β Secrets
|
| 76 |
+
2. Add `OPENAI_API_KEY` = your-key
|
| 77 |
+
3. Update `.env` locally: `LLM_PROVIDER=openai`
|
| 78 |
+
4. Push changes (Space auto-redeploys)
|
| 79 |
|
| 80 |
### Local Deployment
|
| 81 |
```bash
|
|
|
|
| 94 |
- `LLM_MODEL`: Model name (e.g., `gpt-4-turbo`, defaults provided per provider)
|
| 95 |
- `DEBUG`: Set to `true` for verbose logging
|
| 96 |
|
| 97 |
+
### For HF Spaces
|
| 98 |
+
Add secrets via Settings β Secrets instead of `.env`:
|
| 99 |
+
- `OPENAI_API_KEY` for OpenAI
|
| 100 |
+
- `LLM_PROVIDER` (optional, defaults to mock)
|
| 101 |
+
- `DEBUG` (optional)
|
| 102 |
+
|
| 103 |
+
### For Local Development
|
| 104 |
+
Copy `.env.example` to `.env` and edit:
|
| 105 |
+
```bash
|
| 106 |
+
cp .env.example .env
|
| 107 |
+
# Edit with your keys/settings
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
**Important:** `.env` is in `.gitignore` β never commit secrets!
|
| 111 |
+
|
| 112 |
## Example Security Incidents
|
| 113 |
|
| 114 |
Try these in the app:
|
spaces.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
title: Security Incident Analyzer
|
| 2 |
+
description: LLM-powered security log and incident analysis with Gradio UI
|
| 3 |
+
app_file: src/app.py
|
| 4 |
+
sdk: gradio
|
| 5 |
+
sdk_version: 4.11.0
|
| 6 |
+
python_version: 3.9
|