-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Describe the bug
When using artifact_path to load weights from a path with one of the text_generation ModuleBases the caikit runtime emits the following error:
{"channel": "LLOAD", "exception": null, "level": "warning", "log_code": "
<COR98539580W>", "message": "DEPRECATION: Loading f9181353-4ccf-4572-bd1e-f12bcda26792 failed with ModuleConfig. Using model_path. expected str, bytes or os.PathLike object, not ModuleConfig", "num_indent": 0, "thread_id": 140699291752000, "timestamp": "2023-10-27T11:21:44.284465"}
The source of the exception is os.path.join in
| base_model_path = os.path.join(model_path, base_model_path) |
model_path is a ModuleConfig object instead of a str.
Platform
Please provide details about the environment you are using, including the following:
- Interpreter version: 3.11.5
- Library version: 0.22.0
Sample Code
Create the files /tmp/test/runtime_config.yml and /tmp/test/local_models_dir/text_generation/config.yml like so:
File /tmp/test/runtime_config.yml
runtime:
local_models_dir: /tmp/test/local_models_dir/
library: caikit_nlpFile /tmp/test/local_models_dir/text_generation/config.yml
module_id: f9181353-4ccf-4572-bd1e-f12bcda26792
artifact_path: /tmp/test/google-flan-t5-baseDownload the weights of https://huggingface.co/google/flan-t5-base under /tmp/test/google-flan-t5-base
Then run:
export CONFIG_FILES=/tmp/test/runtime_config.yml
python3 -m caikit.runtime
Expected behavior
The TextGeneration ModuleBase in text_generation_local.py should successfully load the weights.
Observed behavior
The LocalModelManager is unable to trigger the loading of the weights using the TextGeneration ModuleBase. The terminal shows the following message:
{"channel": "LLOAD", "exception": null, "level": "warning", "log_code": "
<COR98539580W>", "message": "DEPRECATION: Loading f9181353-4ccf-4572-bd1e-f12bcda26792 failed with ModuleConfig. Using model_path. expected str, bytes or os.PathLike object, not ModuleConfig", "num_indent": 0, "thread_id": 140699291752000, "timestamp": "2023-10-27T11:21:44.284465"}
Additional context
I think the fix is to expect a Union[str, ModuleConfig] for the model_path argument of the ModuleBase.load() methods.