Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,57 +1,64 @@
|
|
| 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 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
```
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
```
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
title: CortexFlow Backend
|
| 2 |
+
emoji: 🧠
|
| 3 |
+
colorFrom: blue
|
| 4 |
+
colorTo: indigo
|
| 5 |
+
sdk: docker
|
| 6 |
+
app_port: 7860
|
| 7 |
+
pinned: false
|
| 8 |
+
# Backend
|
| 9 |
+
|
| 10 |
+
FastAPI backend service for CortexFlow.
|
| 11 |
+
|
| 12 |
+
Joint collaboration repository by the MA2TIC group.
|
| 13 |
+
|
| 14 |
+
Private codebase. Licensing context is defined in [../LICENSE](../LICENSE).
|
| 15 |
+
|
| 16 |
+
## Design Profile
|
| 17 |
+
|
| 18 |
+
- Deterministic feature extraction from transcript and pause signals
|
| 19 |
+
- Confidence and quality notes for low-evidence samples
|
| 20 |
+
- Non-diagnostic safety framing in generated output
|
| 21 |
+
- Groq model usage limited to narrative/safety language, not synthetic metric creation
|
| 22 |
+
|
| 23 |
+
## API Endpoints
|
| 24 |
+
|
| 25 |
+
- `GET /health`
|
| 26 |
+
- `GET /models/recommended`
|
| 27 |
+
- `POST /analyze`
|
| 28 |
+
|
| 29 |
+
`POST /analyze` payload shape:
|
| 30 |
+
|
| 31 |
+
```json
|
| 32 |
+
{
|
| 33 |
+
"input_value": "optional text input",
|
| 34 |
+
"transcript": "optional transcript input",
|
| 35 |
+
"pause_map": [0.32, 0.45],
|
| 36 |
+
"audio_duration": 24.8,
|
| 37 |
+
"session_id": "optional"
|
| 38 |
+
}
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
Response format: streamed NDJSON with step and final events.
|
| 42 |
+
|
| 43 |
+
## Hugging Face Spaces (Docker)
|
| 44 |
+
|
| 45 |
+
Hosting target: Docker Space.
|
| 46 |
+
|
| 47 |
+
Deployment profile:
|
| 48 |
+
|
| 49 |
+
- Repository root in Space contains backend files (`main.py`, `requirements.txt`, `Dockerfile`, supporting modules)
|
| 50 |
+
- Required secret: `GROQ_API_KEY`
|
| 51 |
+
- Container runtime binds to `${PORT}` (default fallback configured in Dockerfile)
|
| 52 |
+
- Health probe endpoint: `GET /health`
|
| 53 |
+
|
| 54 |
+
## Local Development Reference
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
cd backend
|
| 58 |
+
python -m venv .venv
|
| 59 |
+
. .venv/Scripts/Activate.ps1
|
| 60 |
+
pip install -r requirements.txt
|
| 61 |
+
copy .env.example .env
|
| 62 |
+
uvicorn main:app --reload --port 8000
|
| 63 |
+
```
|
| 64 |
+
|