Config: Fix draft model migration and loading
The loader takes in the "draft" parameter, so map the config model to that when creating kwargs for initial load. Also map the old "draft" key to the new "draft_model" key. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
a34bd9a684
commit
754fb15f23
2 changed files with 6 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ class TabbyConfig(TabbyConfigModel):
|
|||
|
||||
if model_cfg.get("draft"):
|
||||
legacy = True
|
||||
cfg["draft"] = model_cfg["draft"]
|
||||
cfg["draft_model"] = model_cfg["draft"]
|
||||
|
||||
if model_cfg.get("lora"):
|
||||
legacy = True
|
||||
|
|
|
|||
6
main.py
6
main.py
|
|
@ -69,7 +69,11 @@ async def entrypoint_async():
|
|||
model_path = model_path / model_name
|
||||
|
||||
# TODO: remove model_dump()
|
||||
await model.load_model(model_path.resolve(), **config.model.model_dump())
|
||||
await model.load_model(
|
||||
model_path.resolve(),
|
||||
**config.model.model_dump(),
|
||||
draft=config.draft_model.model_dump(),
|
||||
)
|
||||
|
||||
# Load loras after loading the model
|
||||
if config.lora.loras:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue