config is now backed by pydantic (WIP)

- add models for config options
- add function to regenerate config.yml
- replace references to config with pydantic compatible references
- remove unnecessary unwrap() statements

TODO:

- auto generate env vars
- auto generate argparse
- test loading a model
This commit is contained in:
Jake
2024-09-05 18:04:56 +01:00
parent cb91670c7a
commit 362b8d5818
11 changed files with 297 additions and 94 deletions

View File

@@ -76,9 +76,9 @@ def _get_download_folder(repo_id: str, repo_type: str, folder_name: Optional[str
"""Gets the download folder for the repo."""
if repo_type == "lora":
download_path = pathlib.Path(config.lora.get("lora_dir") or "loras")
download_path = pathlib.Path(config.lora.lora_dir)
else:
download_path = pathlib.Path(config.model.get("model_dir") or "models")
download_path = pathlib.Path(config.model.model_dir)
download_path = download_path / (folder_name or repo_id.split("/")[-1])
return download_path