mirror of
https://github.com/zotero/zotero.git
synced 2026-10-07 02:58:09 +00:00
add calibration versioning
To be able to trigger reindexing if calibration changes
This commit is contained in:
parent
133e43ac87
commit
fa0b67da2f
1 changed files with 12 additions and 6 deletions
|
|
@ -197,16 +197,22 @@ Zotero.Embeddings = new function () {
|
|||
}));
|
||||
};
|
||||
|
||||
// Bump when how a model is calibrated changes (see Zotero.Embeddings
|
||||
// .Calibration): stored vectors are centered on the measured mean, so a
|
||||
// new measurement means a reindex of every model
|
||||
const CALIBRATION_VERSION = 1;
|
||||
|
||||
/**
|
||||
* Identity of the active embedding function: model name plus its revision.
|
||||
* Any code change that alters the vectors a model produces (dtype, upstream
|
||||
* weights, prefixes, pooling) must bump that model's `revision`, so that
|
||||
* stored embeddings are detected as stale and reindexed (see
|
||||
* Indexing._ensureIndexMatchesModel()).
|
||||
* Identity of the active embedding function: model name, its revision and
|
||||
* the calibration version. Any code change that alters the vectors a model
|
||||
* produces (dtype, upstream weights, prefixes, pooling) must bump that
|
||||
* model's `revision`, and a change to calibration must bump
|
||||
* CALIBRATION_VERSION, so that stored embeddings are detected as stale and
|
||||
* reindexed (see Indexing._ensureIndexMatchesModel()).
|
||||
* @return {String}
|
||||
*/
|
||||
this.getModelVersion = function () {
|
||||
return this.getModelName() + '/' + _getModel().revision;
|
||||
return `${this.getModelName()}/${_getModel().revision}/${CALIBRATION_VERSION}`;
|
||||
};
|
||||
|
||||
// The active model's entry in MODELS. Throws when no model is selected:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue