You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why these changes are being introduced:
Many of the CLI commands will require an embedding class and model to work.
A decorator was created originally that injected a --model-uri CLI argument,
but it also provides a place to load the class itself and become more of a
middleware.
How this addresses that need:
Updates the model_required decorator to also load the embedding model class.
This DRY's up the CLI commands that use it and centralizes that logic and
conventions for the CLI argument, env vars, and whatnot.
Lastly, it is now required to include a 'model_path' when instantiating
a model class instance, and this location is used for both download and
load.
Side effects of this change:
* None
Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/USE-112
Copy file name to clipboardExpand all lines: README.md
+29-9Lines changed: 29 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ WORKSPACE=### Set to `dev` for local development, this will be set to `stage` an
24
24
25
25
```shell
26
26
TE_MODEL_URI=# HuggingFace model URI
27
-
TE_MODEL_DOWNLOAD_PATH=#Download location for model
27
+
TE_MODEL_PATH=#Path where the model will be downloaded to and loaded from
28
28
HF_HUB_DISABLE_PROGRESS_BARS=#boolean to use progress bars for HuggingFace model downloads; defaults to 'true' in deployed contexts
29
29
```
30
30
@@ -34,7 +34,7 @@ This CLI application is designed to create embeddings for input texts. To do th
34
34
35
35
To this end, there is a base embedding class `BaseEmbeddingModel` that is designed to be extended and customized for a particular embedding model.
36
36
37
-
Once an embedding class has been created, the preferred approach is to set env vars `TE_MODEL_URI` and `TE_MODEL_DOWNLOAD_PATH` directly in the `Dockerfile` to a) download a local snapshot of the model during image build, and b) set this model as the default for the CLI.
37
+
Once an embedding class has been created, the preferred approach is to set env vars `TE_MODEL_URI` and `TE_MODEL_PATH` directly in the `Dockerfile` to a) download a local snapshot of the model during image build, and b) set this model as the default for the CLI.
38
38
39
39
This allows invoking the CLI without specifying a model URI or local location, allowing this model to serve as the default, e.g.:
0 commit comments