File size: 2,287 Bytes
c72db2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Hugging Face Space Information

## Space Details

- **Username**: `bldeaw`
- **Space Name**: `ml_service`
- **Full Space Path**: `bldeaw/ml_service`
- **Space URL**: `https://bldeaw-ml-service.hf.space`
- **Git Repository**: `https://huggingface.co/spaces/bldeaw/ml_service`

---

## Quick Commands

### Test API

```bash
# Test health endpoint
curl https://bldeaw-ml-service.hf.space/health

# Test prediction
curl -X POST https://bldeaw-ml-service.hf.space/predict/job-fail \
  -H "Content-Type: application/json" \
  -d '{
    "zone": "prod",
    "job_nm": "daily_export",
    "job_start_time": "2026-01-21T01:00:00",
    "duration_sec": 5400,
    "status": "SUCCESS",
    "explain": true
  }'

# Test anomaly detection
curl -X POST https://bldeaw-ml-service.hf.space/detect/anomaly \
  -H "Content-Type: application/json" \
  -d '{
    "features": {
      "duration_sec": 5400,
      "duration_zscore": 1.6,
      "err_msg_len": 0
    }
  }'
```

### Using Test Script

```bash
# Test Hugging Face Space API
python test_api.py --url https://bldeaw-ml-service.hf.space
```

### Git Commands

```bash
# Clone Space repository
git clone https://huggingface.co/spaces/bldeaw/ml_service
cd ml_service

# Add remote (if working from local repo)
git remote add hf https://huggingface.co/spaces/bldeaw/ml_service

# Push to Space
git push hf main
```

---

## API Endpoints

- **Health Check**: `https://bldeaw-ml-service.hf.space/health`
- **Job Failure Prediction**: `https://bldeaw-ml-service.hf.space/predict/job-fail`
- **Anomaly Detection**: `https://bldeaw-ml-service.hf.space/detect/anomaly`
- **API Documentation**: `https://bldeaw-ml-service.hf.space/docs`
- **ReDoc**: `https://bldeaw-ml-service.hf.space/redoc`

---

## Space Settings

- **SDK**: Docker
- **Hardware**: CPU Basic (or as configured)
- **Visibility**: Public/Private (as configured)
- **Port**: 7860 (Hugging Face Spaces default)

---

## Deployment Status

Check deployment status at:
- **Space Page**: https://huggingface.co/spaces/bldeaw/ml_service
- **Logs**: https://huggingface.co/spaces/bldeaw/ml_service/logs

---

## Notes

- Space URL format: `https://{username}-{space-name}.hf.space`
- Replace hyphens in space name with hyphens in URL
- Example: `bldeaw/ml_service``bldeaw-ml-service.hf.space`