mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix flake8 warnings
This commit is contained in:
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user