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.
This commit is contained in:
2026-04-23 11:09:55 +07:00
parent a1fd486937
commit 8140b51d3d
4 changed files with 1 additions and 6 deletions
+1 -2
View File
@@ -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
-1
View File
@@ -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
-2
View File
@@ -110,7 +110,6 @@ Host the desired zip and update `.env`:
```bash
MODEL_URL=https://cloud.example.com/s/<token-for-syllables-100>/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)
-1
View File
@@ -11,7 +11,6 @@ services:
# https://cloud.example.com/s/<shareToken>/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