From 8140b51d3d75b2060dfdd0e88995ada8e07b84d3 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Thu, 23 Apr 2026 11:09:55 +0700 Subject: [PATCH] refactor: remove unused MODEL_VARIANT env var Was set in Dockerfile/compose/.env/README but never read by the app. Tokenization is inferred at lookup time by _variant_candidates trying both spaced and underscore-joined forms. --- .env.example | 3 +-- Dockerfile | 1 - README.md | 2 -- docker-compose.yml | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 7b31bdf..eca3534 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,5 @@ # MODEL_URL=https://cloud.example.com/s/abc123XYZ/download MODEL_URL=https://cloud.example.com/s/REPLACE_ME/download -# Variant — must match the filename inside the zip. +# Must match the filename inside the zip. MODEL_PATH=/data/phow2v/word2vec_vi_words_300dims.txt -MODEL_VARIANT=word diff --git a/Dockerfile b/Dockerfile index fffb065..3459e5f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,6 @@ COPY app ./app # PhoW2V's license forbids public redistribution, so every deployment # must point at its own private mirror (typically Nextcloud WebDAV). ENV MODEL_PATH=/data/phow2v/word2vec_vi_words_300dims.txt \ - MODEL_VARIANT=word \ PORT=8000 EXPOSE 8000 diff --git a/README.md b/README.md index 7050297..a389aea 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,6 @@ Host the desired zip and update `.env`: ```bash MODEL_URL=https://cloud.example.com/s//download MODEL_PATH=/data/phow2v/word2vec_vi_syllables_100dims.txt -MODEL_VARIANT=syllable ``` Delete the `phow2v-cache` volume when switching, otherwise the stale @@ -126,7 +125,6 @@ docker compose down -v && docker compose up --build |---|---|---| | `MODEL_URL` | *(required)* | Any URL that serves the zip via a plain GET. Bake any auth into the URL. | | `MODEL_PATH` | `/data/phow2v/word2vec_vi_words_300dims.txt` | Where the text-format vectors are persisted. | -| `MODEL_VARIANT` | `word` | `word` or `syllable`. Declarative hint; must match the file you uploaded. | ## Using from doantu (miti99bot) diff --git a/docker-compose.yml b/docker-compose.yml index 8a1e8ad..784d3da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,6 @@ services: # https://cloud.example.com/s//download MODEL_URL: ${MODEL_URL:?set MODEL_URL in .env to your PhoW2V zip URL} MODEL_PATH: ${MODEL_PATH:-/data/phow2v/word2vec_vi_words_300dims.txt} - MODEL_VARIANT: ${MODEL_VARIANT:-word} volumes: - phow2v-cache:/data/phow2v restart: unless-stopped