mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Run Ruff
This commit is contained in:
parent
56fda669fd
commit
9ed53af520
@ -101,10 +101,7 @@ class FluxTextToImageInvocation(BaseInvocation, WithMetadata, WithBoard):
|
||||
# if the cache is not empty.
|
||||
# context.models._services.model_manager.load.ram_cache.make_room(24 * 2**30)
|
||||
|
||||
with (
|
||||
transformer_info as transformer,
|
||||
scheduler_info as scheduler
|
||||
):
|
||||
with transformer_info as transformer, scheduler_info as scheduler:
|
||||
assert isinstance(transformer, FluxTransformer2DModel)
|
||||
assert isinstance(scheduler, FlowMatchEulerDiscreteScheduler)
|
||||
|
||||
|
@ -60,11 +60,11 @@ class CLIPField(BaseModel):
|
||||
loras: List[LoRAField] = Field(description="LoRAs to apply on model loading")
|
||||
|
||||
|
||||
|
||||
class TransformerField(BaseModel):
|
||||
transformer: ModelIdentifierField = Field(description="Info to load Transformer submodel")
|
||||
scheduler: ModelIdentifierField = Field(description="Info to load scheduler submodel")
|
||||
|
||||
|
||||
class T5EncoderField(BaseModel):
|
||||
tokenizer: ModelIdentifierField = Field(description="Info to load tokenizer submodel")
|
||||
text_encoder: ModelIdentifierField = Field(description="Info to load text_encoder submodel")
|
||||
|
@ -52,9 +52,7 @@ def calc_model_size_by_data(logger: logging.Logger, model: AnyModel) -> int:
|
||||
return model.calc_size()
|
||||
elif isinstance(
|
||||
model,
|
||||
(
|
||||
T5TokenizerFast,
|
||||
),
|
||||
(T5TokenizerFast,),
|
||||
):
|
||||
return len(model)
|
||||
else:
|
||||
|
@ -15,7 +15,9 @@ from invokeai.backend.requantize import requantize
|
||||
|
||||
class FastQuantizedTransformersModel(QuantizedTransformersModel):
|
||||
@classmethod
|
||||
def from_pretrained(cls, model_name_or_path: Union[str, os.PathLike], auto_class = AutoModelForTextEncoding, **kwargs):
|
||||
def from_pretrained(
|
||||
cls, model_name_or_path: Union[str, os.PathLike], auto_class=AutoModelForTextEncoding, **kwargs
|
||||
):
|
||||
"""We override the `from_pretrained()` method in order to use our custom `requantize()` implementation."""
|
||||
auto_class = auto_class or cls.auto_class
|
||||
if auto_class is None:
|
||||
|
Loading…
Reference in New Issue
Block a user