[fix] ontology: 임베딩 모델을 볼륨에 남김 — transformers.js 4.x 가 TRANSFORMERS_CACHE 를 무시
컨테이너를 새로 만들 때마다 모델 465MB 를 다시 받았다(실측 2분 49초). 그 사이 첫 발행은 publish 60초 상한을 넘겨 키워드 없이 나간다. 4.x 는 이 변수를 읽지 않고 node_modules 아래에 받아서 ontology-model 볼륨(/app/.cache)이 비어 있었다. - config/env: embedding.cacheDir ← TRANSFORMERS_CACHE - local.provider: transformers.js env.cacheDir 로 넘김 tsc 통과. 로컬 compose: 재생성 후 /app/.cache 465M, 다시 재생성하면 모델 로딩 1.7초 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f32edfeaa1
commit
3538e2dbc9
3 files changed
+7
-1
No files matched your search
@@ -19,7 +19,8 @@ export class LocalEmbeddingProvider extends EmbeddingProvider {
|
||||
if (!this.loading) {
|
||||
this.loading = (async () => {
|
||||
const t0 = Date.now();
|
||||
const { pipeline } = await esmImport('@huggingface/transformers');
|
||||
const { pipeline, env: tf } = await esmImport('@huggingface/transformers');
|
||||
if (env.embedding.cacheDir) tf.cacheDir = env.embedding.cacheDir;
|
||||
const fe = await pipeline('feature-extraction', env.embedding.localModel);
|
||||
this.logger.log(`model ready: ${env.embedding.localModel} (${Date.now() - t0}ms)`);
|
||||
this.extractor = fe;
|
||||
|
||||
Reference in new issue
Block a user