Page MenuHomePhabricator
Paste P86768

Testing locally revertrisk base model treating testwiki' as 'enwiki' on the fly.
ActivePublic

Authored by gkyziridis on Jan 6 2026, 10:57 AM.
$ curl \
-s localhost:8080/v1/models/revertrisk-language-agnostic:predict \
-i -X POST -d '{"lang": "test", "rev_id": 1}'
HTTP/1.1 422 Unprocessable Entity
date: Tue, 06 Jan 2026 10:55:22 GMT
server: uvicorn
content-length: 114
content-type: application/json
{"detail":"Could not make prediction for revisions dict_keys([(1, 'test')]). Reason: ['parent_revision_missing']"}%
$ curl \
-s localhost:8080/v1/models/revertrisk-language-agnostic:predict \
-i -X POST -d '{"lang": "test", "rev_id": 2}'
HTTP/1.1 200 OK
date: Tue, 06 Jan 2026 10:55:30 GMT
server: uvicorn
content-length: 203
content-type: application/json
{"model_name":"revertrisk-language-agnostic","model_version":"3","wiki_db":"testwiki","revision_id":2,"output":{"prediction":true,"probabilities":{"true":0.8534709215164185,"false":0.14652907848358154}}}%
$ curl \
-s localhost:8080/v1/models/revertrisk-language-agnostic:predict \
-i -X POST -d '{"lang": "test", "rev_id": 3}'
HTTP/1.1 200 OK
date: Tue, 06 Jan 2026 10:55:37 GMT
server: uvicorn
content-length: 200
content-type: application/json
{"model_name":"revertrisk-language-agnostic","model_version":"3","wiki_db":"testwiki","revision_id":3,"output":{"prediction":true,"probabilities":{"true":0.648537814617157,"false":0.351462185382843}}}%