Skip to content

Commit

Permalink
fix: other recursive imports
Browse files Browse the repository at this point in the history
  • Loading branch information
blessedcoolant committed Jun 9, 2024
1 parent 8f7326d commit b52472a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
5 changes: 1 addition & 4 deletions invokeai/app/services/download/download_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import traceback
from pathlib import Path
from queue import Empty, PriorityQueue
from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Set
from typing import Any, Dict, List, Literal, Optional, Set

import requests
from pydantic.networks import AnyHttpUrl
Expand All @@ -34,9 +34,6 @@
UnknownJobIDException,
)

if TYPE_CHECKING:
from invokeai.app.services.events.events_base import EventServiceBase

# Maximum number of bytes to download during each call to requests.iter_content()
DOWNLOAD_CHUNK_SIZE = 100000

Expand Down
1 change: 0 additions & 1 deletion invokeai/app/services/events/events_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
if TYPE_CHECKING:
from invokeai.app.invocations.baseinvocation import BaseInvocation, BaseInvocationOutput
from invokeai.app.services.download.download_base import DownloadJob
from invokeai.app.services.events.events_common import EventBase
from invokeai.app.services.model_install.model_install_common import ModelInstallJob
from invokeai.app.services.session_processor.session_processor_common import ProgressImage
from invokeai.app.services.session_queue.session_queue_common import (
Expand Down
18 changes: 9 additions & 9 deletions invokeai/app/services/model_install/model_install_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from queue import Empty, Queue
from shutil import copyfile, copytree, move, rmtree
from tempfile import mkdtemp
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, Union
from typing import Any, Dict, List, Optional, Tuple, Type, Union

import torch
import yaml
Expand Down Expand Up @@ -60,9 +60,6 @@

TMPDIR_PREFIX = "tmpinstall_"

if TYPE_CHECKING:
from invokeai.app.services.events.events_base import EventServiceBase


class ModelInstallService(ModelInstallServiceBase):
"""class for InvokeAI model installation."""
Expand Down Expand Up @@ -412,11 +409,14 @@ def _remote_files_from_source(
if isinstance(source, HFModelSource):
metadata = HuggingFaceMetadataFetch(self._session).from_id(source.repo_id, source.variant)
assert isinstance(metadata, ModelMetadataWithFiles)
return metadata.download_urls(
variant=source.variant or self._guess_variant(),
subfolder=source.subfolder,
session=self._session,
), metadata
return (
metadata.download_urls(
variant=source.variant or self._guess_variant(),
subfolder=source.subfolder,
session=self._session,
),
metadata,
)

if isinstance(source, URLModelSource):
try:
Expand Down

0 comments on commit b52472a

Please sign in to comment.