Files
ForexBot2/deploy/gold-dashboard.service
Harwinder Sekhon 42025da0b0 Local news model: ML-NEWS XAU transformer scores headlines (news_model.py, mode primary)
The owner's DeBERTa-v3-small two-head ONNX model (golden set 72/78, ~72%
agreement with DeepSeek on unseen days) replaces DeepSeek for headline
scoring. DeepSeek keeps event direction, the summary and the dashboard
endpoint.

- news_model.py: vendored ML-NEWS runtime (lazy onnxruntime/tokenizers,
  so the bot starts without them) + load-once, never-raising singleton.
- news_engine: _enrich_headline_scores mode switch (off/fallback/primary),
  _apply_model_sentiment (gold head only: xau_score + XAU entry, never
  USD; not-relevant shows 0.0; never touches _llm_sent_cache),
  _audit_with_deepseek (archive-only labels, deepseek_audit_per_day).
- Owner decision: primary mode writes nothing to logs/newsdata.db except
  audit copies — the model's output is not training data.
- app_config: news_model section (path/threads/mode/deepseek_audit_per_day)
  + NEWS_MODEL_MODE env override; validated at boot.
- news_archive: model rows carry teacher_model xau_transformer@<trained_at>.
- deploy/README-news-model.md (ops for bot + dashboard daemon), unit gets a
  commented NEWS_MODEL_MODE=off line; requirements + onnxruntime, tokenizers.
- test_all.py Module 38 (15 tests, one against the real bundle). Suite 581.
- CLAUDE.md, spec status note, handoff marked implemented.

Books unaffected: news never enters signals; no signal file touched.
2026-09-27 21:02:42 -04:00

28 lines
982 B
Desktop File

# systemd unit for the XAU/USD static dashboard publisher.
# Install (as root, on the live server):
# cp deploy/gold-dashboard.service /etc/systemd/system/
# systemctl daemon-reload && systemctl enable --now gold-dashboard
# See deploy/README-dashboard.md for the full checklist.
[Unit]
Description=XAU/USD dashboard publisher (writes static JSON/HTML for Apache)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
# Adjust to the account that owns /home/Forex/ForexBot2:
User=Forex
WorkingDirectory=/home/Forex/ForexBot2
Environment=DASHBOARD_OUT_DIR=/var/www/trade
# The local news model (deploy/README-news-model.md) loads in this process
# too (~0.6 GB RSS) so the dashboard shows the bot's headline scores.
# Uncomment to keep this daemon on DeepSeek when memory is short:
#Environment=NEWS_MODEL_MODE=off
ExecStart=/home/Forex/ForexBot2/venv/bin/python dashboard_publisher.py
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target