ml_service / SPACE_INFO.md
bldeaw's picture
Deploy to Hugging Face Spaces: Fix model loading and add documentation
c72db2d
|
Raw
History Blame Contribute Delete
2.29 kB

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

# 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

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

Git Commands

# 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:


Notes

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