fix flake8 warnings

This commit is contained in:
Lincoln Stein
2023-09-07 09:16:56 -04:00
parent 82499d4ef0
commit 11ead34022
5 changed files with 8 additions and 9 deletions

View File

@ -16,4 +16,4 @@ from .config import ( # noqa F401
from .install import ModelInstall # noqa F401
from .probe import ModelProbe, InvalidModelException # noqa F401
from .storage import DuplicateModelException # noqa F401
from .search import ModelSearch
from .search import ModelSearch # noqa F401

View File

@ -7,9 +7,8 @@ from abc import ABC, abstractmethod
from enum import Enum
from functools import total_ordering
from pathlib import Path
from typing import Set, List, Optional, Dict, Callable
from pydantic import BaseModel, Field, validator, ValidationError
from pydantic.networks import AnyHttpUrl
from typing import List, Optional, Callable
from pydantic import BaseModel, Field
class DownloadJobStatus(str, Enum):

View File

@ -278,7 +278,7 @@ class ModelInstall(ModelInstallBase):
id = self.register(model)
self._logger.info(f"Registered {model} with id {id}")
self._installed.add(id)
except DuplicateModelException as exc:
except DuplicateModelException:
pass
return True
@ -287,6 +287,6 @@ class ModelInstall(ModelInstallBase):
id = self.install(model)
self._logger.info(f"Installed {model} with id {id}")
self._installed.add(id)
except DuplicateModelException as exc:
except DuplicateModelException:
pass
return True

View File

@ -516,7 +516,7 @@ class TextualInversionFolderProbe(FolderProbeBase):
"""Return the ModelBaseType of the HuggingFace-style Textual Inversion Folder."""
path = self.model / "learned_embeds.bin"
if not path.exists():
raise InvalidModelException(f"This textual inversion folder does not contain a learned_embeds.bin file.")
raise InvalidModelException("This textual inversion folder does not contain a learned_embeds.bin file.")
return TextualInversionCheckpointProbe(path).get_base_type()

View File

@ -15,14 +15,14 @@ Example usage:
search = ModelSearch(on_model_found=report_it)
found = search.search('/tmp/models')
print(found) # list of matching model paths
print(found) # list of matching model paths
print(search.stats) # search stats
```
"""
import os
from abc import ABC, abstractmethod
from typing import Set, Optional, Callable, Union, types
from typing import Set, Optional, Callable, Union
from pathlib import Path
from invokeai.backend.util.logging import InvokeAILogger