spacy-fa-pipeline/.omp/AGENTS.md

58 lines
2.1 KiB
Markdown

# Repo context for agents
## Remotes
| Name | URL | Purpose |
|---|---|---|
| `gitea` | `https://gitea.cap.nlogn.ir/fazel/spacy-fa-pipeline.git` | Primary self-hosted Gitea |
## Pushing to Gitea
Credentials come from `rbw` (Bitwarden CLI) — no token in git config or any tracked file.
**rbw entry:** `api/gitea_token_AllExceptAdmin`
> Note: the older `site_farsi` convention used `pass gitea/token_AllExceptAdmin`. That entry
> exists but its GPG agent is not unlocked on this machine — `pass` blocks for ~60s and
> returns empty. Use `rbw`.
The credential helper is set locally in `.git/config` (never committed):
```
credential.https://gitea.cap.nlogn.ir.helper=
!f() { echo username=fazel; echo password=$(rbw get "api/gitea_token_AllExceptAdmin" | head -1); }; f
```
**Push command** (bypass proxy — Gitea is on the local network):
```bash
NO_PROXY="*" no_proxy="*" http_proxy="" https_proxy="" HTTP_PROXY="" HTTPS_PROXY="" \
git push gitea main
```
If `rbw` is locked, `rbw unlock` first. To rotate: update in the Gitea UI, then
`rbw edit "api/gitea_token_AllExceptAdmin"`. No git config change needed.
## What is NOT committed
`.gitignore` excludes `assets/ corpus/ training/ metrics/ packages/ .venv/`. The repo holds
only source: configs, scripts, `project.yml`, docs. Everything else is regenerated:
```bash
python -m venv .venv && .venv/bin/python -m pip install -r requirements.txt
.venv/bin/python -m spacy project assets # checksummed downloads
.venv/bin/python -m spacy project run all # ~2h on 4 CPU cores
```
The trained wheel (13 MB) is a build artifact, not source. Publish it to the HF Hub instead —
see `docs/CONTRIBUTING-GUIDE.md` §2.
## Environment
The venv is Python 3.12.2, created from the conda env at `/home/fazel/anaconda3/envs/p12`
(the anaconda base python is 3.7 and cannot run spaCy 3.8). The IPython kernel available to
agents is bound to that 3.7 base and will fail on this project — shell out to `.venv/bin/python`.
GPU (GTX 940MX, 2 GB) is unused: too small for a transformer, not worth the transfer overhead
for an `sm` pipeline. All training is CPU, `--gpu-id -1`.