several small model install enhancements

- Support extended HF repoid syntax in TUI. This allows
  installation of subfolders and safetensors files, as in
  `XpucT/Deliberate::Deliberate_v5.safetensors`

- Add `error` and `error_traceback` properties to the install
  job objects.

- Rename the `heuristic_import` route to `heuristic_install`.

- Fix the example `config` input in the `heuristic_install` route.
This commit is contained in:
Lincoln Stein
2024-02-21 17:15:54 -05:00
committed by psychedelicious
parent 1cec0bb179
commit cc41e8912c
4 changed files with 20 additions and 45 deletions

View File

@ -382,8 +382,8 @@ async def add_model_record(
@model_manager_router.post(
"/heuristic_import",
operation_id="heuristic_import_model",
"/heuristic_install",
operation_id="heuristic_install_model",
responses={
201: {"description": "The model imported successfully"},
415: {"description": "Unrecognized file/folder format"},
@ -392,12 +392,12 @@ async def add_model_record(
},
status_code=201,
)
async def heuristic_import(
async def heuristic_install(
source: str,
config: Optional[Dict[str, Any]] = Body(
description="Dict of fields that override auto-probed values in the model config record, such as name, description and prediction_type ",
default=None,
example={"name": "modelT", "description": "antique cars"},
example={"name": "string", "description": "string"},
),
access_token: Optional[str] = None,
) -> ModelInstallJob: