cdotsanghvi's picture
add multi-head demo as 4th-6th tabs; restore Why Liquid + Integration
083b138
Raw
History Blame Contribute Delete
1.83 kB
"""Hugging Face Spaces entrypoint for the unified Transaction Encoder demo.
Wrapper that invokes encoder.src.demo.copilot_app_unified.main with
paths relative to the Space repo root. The full app code lives at
encoder/src/demo/copilot_app_unified.py.
Six tabs:
- Multi-Head Demo (original V3 encoder + 4 task heads)
- Why Liquid (architectural pitch)
- Integration (build-it-yourself guide)
- Dispute Co-Pilot (friendly-fraud classifier + attribution)
- Collections Co-Pilot (treatment-response scoreboard)
- Fraud Co-Pilot (pattern stage × type classifier)
"""
import sys
from pathlib import Path
# Make the bundled source tree importable.
sys.path.insert(0, str(Path(__file__).parent))
from encoder.src.demo.copilot_app_unified import main
sys.argv = [
"app",
# Multi-head (original) demo
"--multihead-checkpoint", "checkpoints/multihead_v3.pt",
"--multihead-config", "encoder/configs/model_nocompress.yaml",
"--multihead-data-dir", "data/synthetic",
# Co-Pilot surfaces
"--dispute-checkpoint", "checkpoints/dispute_legitimacy_v7.pt",
"--dispute-config", "encoder/configs/model_dispute_legitimacy.yaml",
"--dispute-cast", "encoder/data/demo_cast.json",
"--collections-checkpoint", "checkpoints/collections_v3.pt",
"--collections-config", "encoder/configs/model_collections.yaml",
"--collections-cast", "encoder/data/collections_cast.json",
"--fraud-checkpoint", "checkpoints/fraud_pattern_v1.pt",
"--fraud-config", "encoder/configs/model_fraud_pattern.yaml",
"--fraud-cast", "encoder/data/fraud_pattern_cast.json",
# Shared
"--schema", "data/schema.yaml",
"--cast-histories", "data/synthetic/cast_token_ids.npy",
"--device", "cpu",
"--dtype", "float32",
"--port", "7860",
]
main()