Spaces:
Paused
Paused
π§ Hugging Face Spaces Configuration
YAML Front Matter Configuration
File README.md harus dimulai dengan YAML front matter configuration:
---
title: FunCaptcha Solver API
emoji: π§©
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
suggested_hardware: cpu-basic
app_file: app.py
---
π Configuration Options
Required Fields
| Field | Value | Description |
|---|---|---|
sdk |
docker |
CRITICAL: Must be "docker" for Docker-based spaces |
title |
FunCaptcha Solver API |
Display name di HF Spaces |
Optional Fields
| Field | Default Value | Description | Options |
|---|---|---|---|
emoji |
π§© |
Icon untuk space | Any emoji |
colorFrom |
blue |
Gradient start color | blue, red, green, yellow, etc. |
colorTo |
purple |
Gradient end color | purple, pink, orange, etc. |
pinned |
false |
Pin space di profile | true / false |
app_file |
app.py |
Main application file | Any Python file |
suggested_hardware |
cpu-basic |
Hardware suggestion | See below |
Hardware Options
| Hardware | Description | Use Case |
|---|---|---|
cpu-basic |
2 vCPU, 16GB RAM | β Recommended untuk FunCaptcha |
cpu-upgrade |
8 vCPU, 32GB RAM | Heavy ML workloads |
t4-small |
GPU T4, 15GB VRAM | GPU-accelerated inference |
t4-medium |
GPU T4, 60GB RAM | Large GPU models |
π‘ Tip:
cpu-basicsudah cukup untuk FunCaptcha solver dengan optimasi yang sudah diterapkan.
π¨ Common Configuration Errors
Error: "Missing configuration in README"
Cause: README.md tidak dimulai dengan YAML front matter
Solution:
# β WRONG - Missing YAML front matter
# FunCaptcha Solver API
# β
CORRECT - With YAML front matter
---
title: FunCaptcha Solver API
emoji: π§©
sdk: docker
---
# FunCaptcha Solver API
Error: "Invalid SDK configuration"
Cause: sdk field salah atau missing
Solution:
# β WRONG
sdk: python
# or missing sdk field
# β
CORRECT
sdk: docker
Error: "Space fails to start"
Possible causes & solutions:
Dockerfile issues
- Check Dockerfile syntax
- Verify all dependencies installed
- Check port 7860 exposed
Missing model files
- Upload
best.onnxdandata.yaml - Check file paths in app.py
- Upload
Missing API key
- Set
FUNCAPTCHA_API_KEYdi space secrets - Verify secret name exactly matches
- Set
π οΈ Customization Options
Custom Title & Branding
---
title: Your Custom FunCaptcha API
emoji: π€
colorFrom: green
colorTo: blue
---
Private Space
Set space visibility to Private during creation (tidak bisa diubah via YAML).
Custom App File
Jika rename app.py:
---
sdk: docker
app_file: main.py # Your custom filename
---
Hardware Upgrade
Untuk performa lebih tinggi:
---
sdk: docker
suggested_hardware: cpu-upgrade # More powerful CPU
---
π Validation Checklist
Sebelum deploy, pastikan:
- README.md dimulai dengan
--- -
sdk: dockerfield present -
titlefield specified - YAML format valid (no tabs, proper indentation)
- File ends dengan
---dan newline - No syntax errors dalam YAML
π§ͺ Testing Configuration
# Test YAML syntax locally
python -c "import yaml; yaml.safe_load(open('README.md').read().split('---')[1])"
# Check for required fields
grep -E "^(sdk|title):" README.md
π Template untuk Custom Spaces
---
title: "Your App Name"
emoji: π
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
suggested_hardware: cpu-basic
app_file: app.py
license: mit
short_description: "Brief description of your space"
---
# Your App Name
Your app description here...
β οΈ CRITICAL: Tanpa proper YAML front matter, HF Spaces tidak akan recognize space sebagai Docker-based application dan akan fail untuk start!
β
Quick Fix: Copy exact YAML header dari README.md yang sudah disediakan dalam deployment package.