From a725dd453934a2b079981587e61e1032341f3f2b Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Mon, 2 Jun 2025 17:54:40 +0200 Subject: [PATCH 1/6] fixed model outputs to not run in an infinte loop --- src/aiunn/upsampler/aiunn.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/aiunn/upsampler/aiunn.py b/src/aiunn/upsampler/aiunn.py index 71c77f3..a5ba3b4 100644 --- a/src/aiunn/upsampler/aiunn.py +++ b/src/aiunn/upsampler/aiunn.py @@ -32,7 +32,18 @@ class aiuNN(PreTrainedModel): def forward(self, x): if self.base_model is None: raise ValueError("Base model is not loaded. Call 'load_base_model' before forwarding.") - x = self.base_model(x) # Get base features + + # Get base features - we need to extract the last hidden state if it's returned as part of a tuple/dict + base_output = self.base_model(x) + if isinstance(base_output, tuple): + x = base_output[0] + elif isinstance(base_output, dict): + x = base_output.get('last_hidden_state', base_output.get('hidden_states')) + if x is None: + raise ValueError("Expected 'last_hidden_state' or 'hidden_states' in model output") + else: + x = base_output + x = self.pixel_shuffle_conv(x) # Expand channels for shuffling x = self.pixel_shuffle(x) # Rearrange channels into spatial dimensions return x -- 2.34.1 From 43260a977b2badebd4f41d4cbd71fee72bd48efc Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Mon, 2 Jun 2025 17:55:41 +0200 Subject: [PATCH 2/6] updated version number --- pyproject.toml | 2 +- setup.py | 2 +- src/aiunn/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6be914a..68125b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=45", "wheel"] build-backend = "setuptools.build_meta" [project] name = "aiunn" -version = "0.1.1" +version = "0.2.2" description = "Finetuner for image upscaling using AIIA" readme = "README.md" requires-python = ">=3.10" diff --git a/setup.py b/setup.py index e934f29..57c0fa6 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="aiunn", - version="0.2.1", + version="0.2.2", packages=find_packages(where="src"), package_dir={"": "src"}, install_requires=[ diff --git a/src/aiunn/__init__.py b/src/aiunn/__init__.py index 03bd20e..dd7a3cd 100644 --- a/src/aiunn/__init__.py +++ b/src/aiunn/__init__.py @@ -3,4 +3,4 @@ from .upsampler.aiunn import aiuNN from .upsampler.config import aiuNNConfig from .inference.inference import aiuNNInference -__version__ = "0.2.1" \ No newline at end of file +__version__ = "0.2.2" \ No newline at end of file -- 2.34.1 From 6df5fc2e724e24487a206edcb422a7b67800c186 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Mon, 2 Jun 2025 17:58:38 +0200 Subject: [PATCH 3/6] corrected requirements --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 57c0fa6..0c62032 100644 --- a/setup.py +++ b/setup.py @@ -7,13 +7,10 @@ setup( package_dir={"": "src"}, install_requires=[ "torch", - "aiia", "pillow", "torchvision", "scikit-learn", - ], - dependency_links=[ - "git+https://gitea.fabelous.app/Machine-Learning/AIIA.git#egg=aiia" + "aiia @ git+https://gitea.fabelous.app/Machine-Learning/AIIA.git" ], python_requires=">=3.10", ) \ No newline at end of file -- 2.34.1 From b4d5c35928704c2ad6e74487be4bc9a820da9b35 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Mon, 2 Jun 2025 18:02:20 +0200 Subject: [PATCH 4/6] fixed aiia error in requirments --- requirements.txt | 1 - setup.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0f9fefa..28a23c2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ torch -aiia pillow torchvision scikit-learn diff --git a/setup.py b/setup.py index 0c62032..57c0fa6 100644 --- a/setup.py +++ b/setup.py @@ -7,10 +7,13 @@ setup( package_dir={"": "src"}, install_requires=[ "torch", + "aiia", "pillow", "torchvision", "scikit-learn", - "aiia @ git+https://gitea.fabelous.app/Machine-Learning/AIIA.git" + ], + dependency_links=[ + "git+https://gitea.fabelous.app/Machine-Learning/AIIA.git#egg=aiia" ], python_requires=">=3.10", ) \ No newline at end of file -- 2.34.1 From d37a0fab5e688aadbb8df1225e49cda77ec6c321 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Mon, 2 Jun 2025 18:02:38 +0200 Subject: [PATCH 5/6] corrected manifest --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 6925c8f..9577509 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include LICENSE include README.md include requirements.txt -recursive-include src/aiia * \ No newline at end of file +recursive-include src/aiunn * \ No newline at end of file -- 2.34.1 From 9aa66cbe3379ce6df6c54a576c083f4d29a87cdb Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Mon, 2 Jun 2025 18:04:37 +0200 Subject: [PATCH 6/6] added missing requirment for pandas --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 28a23c2..66793ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ torch pillow +pandas torchvision scikit-learn git+https://gitea.fabelous.app/Machine-Learning/AIIA.git \ No newline at end of file -- 2.34.1