From 8307748cabc75af13aff11e52d820439c65f8c02 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Fri, 28 Mar 2025 16:09:14 +0100 Subject: [PATCH 1/6] added tests --- .gitea/embed.yaml | 37 ++++++++++++++++++++++++++++++++++++ .gitea/test.yaml | 37 ++++++++++++++++++++++++++++++++++++ src/aiunn/upsampler/aiunn.py | 4 ++-- 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 .gitea/embed.yaml create mode 100644 .gitea/test.yaml diff --git a/.gitea/embed.yaml b/.gitea/embed.yaml new file mode 100644 index 0000000..22c5bda --- /dev/null +++ b/.gitea/embed.yaml @@ -0,0 +1,37 @@ +name: Run VectorLoader Script + +on: + push: + branches: + - main + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.11.7' + + - name: Clone additional repository + run: | + git config --global credential.helper cache + git clone https://fabel:${{ secrets.CICD }}@gitea.fabelous.app/fabel/VectorLoader.git + + - name: Install dependencies + run: | + cd VectorLoader + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run vectorizing + env: + VECTORDB_TOKEN: ${{ secrets.VECTORDB_TOKEN }} + run: | + cd VectorLoader + python -m src.run --full diff --git a/.gitea/test.yaml b/.gitea/test.yaml new file mode 100644 index 0000000..b754440 --- /dev/null +++ b/.gitea/test.yaml @@ -0,0 +1,37 @@ +name: Gitea Actions For AIIA +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11.7' + + - name: Cache pip and model + uses: actions/cache@v3 + with: + path: | + ~/.cache/pip + ./fabel + key: ${{ runner.os }}-pip-model-${{ hashFiles('requirements.txt', 'requirements-dev.txt') }} + + restore-keys: | + ${{ runner.os }}-pip-model- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-dev.txt + pip install -e . + - name: Run tests + run: | + pytest tests/ \ No newline at end of file diff --git a/src/aiunn/upsampler/aiunn.py b/src/aiunn/upsampler/aiunn.py index b0c26b2..ecb3c21 100644 --- a/src/aiunn/upsampler/aiunn.py +++ b/src/aiunn/upsampler/aiunn.py @@ -149,8 +149,8 @@ if __name__ == "__main__": upsampler = aiuNN(base_model, config=ai_config) # Save the model (both configuration and weights). - upsampler.save("hehe") + upsampler.save("aiunn") # Now load using the overridden load method; this will load the complete model. - upsampler_loaded = aiuNN.load("hehe", precision="bf16") + upsampler_loaded = aiuNN.load("aiunn", precision="bf16") print("Updated configuration:", upsampler_loaded.config.__dict__) From 942f4f5a2462e1c90eb83f8c214ca7c2535bb721 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Fri, 28 Mar 2025 16:10:59 +0100 Subject: [PATCH 2/6] moved workflows to correct folder --- .gitea/{ => workflows}/embed.yaml | 0 .gitea/{ => workflows}/test.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .gitea/{ => workflows}/embed.yaml (100%) rename .gitea/{ => workflows}/test.yaml (100%) diff --git a/.gitea/embed.yaml b/.gitea/workflows/embed.yaml similarity index 100% rename from .gitea/embed.yaml rename to .gitea/workflows/embed.yaml diff --git a/.gitea/test.yaml b/.gitea/workflows/test.yaml similarity index 100% rename from .gitea/test.yaml rename to .gitea/workflows/test.yaml From 3feccc525e17ff8858c675cdaec9d9884f424d95 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Fri, 28 Mar 2025 16:49:34 +0100 Subject: [PATCH 3/6] correctly stateted aiia in requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 6b388e0..d97067b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ aiia pillow torchvision sklearn -https://gitea.fabelous.app/Machine-Learning/AIIA.git \ No newline at end of file +git+https://gitea.fabelous.app/Machine-Learning/AIIA.git \ No newline at end of file From 925ae1b189d42efdbaf0281e0808d8c91d7bde91 Mon Sep 17 00:00:00 2001 From: Falko Victor Habel Date: Sun, 30 Mar 2025 14:54:42 +0000 Subject: [PATCH 4/6] requirements.txt aktualisiert --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d97067b..0f9fefa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ torch aiia pillow torchvision -sklearn +scikit-learn git+https://gitea.fabelous.app/Machine-Learning/AIIA.git \ No newline at end of file From 0545c10092729cc5b07630177cbe53975a2402c8 Mon Sep 17 00:00:00 2001 From: Falko Victor Habel Date: Wed, 2 Apr 2025 12:15:13 +0000 Subject: [PATCH 5/6] pyproject.toml aktualisiert --- pyproject.toml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 10e9c2a..6be914a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,15 @@ [build-system] requires = ["setuptools>=45", "wheel"] build-backend = "setuptools.build_meta" - [project] name = "aiunn" -version = "0.1.2" +version = "0.1.1" description = "Finetuner for image upscaling using AIIA" readme = "README.md" requires-python = ">=3.10" license = {file = "LICENSE"} authors = [ - {name = "Falko Habel", email = "falko.habel@gmx.de"}, +{name = "Falko Habel", email = "falko.habel@gmx.de"}, ] - [project.urls] -"Homepage" = "https://gitea.fabelous.app/Machine-Learning/aiuNN" \ No newline at end of file +"Homepage"="https://gitea.fabelous.app/Machine-Learning/aiuNN" \ No newline at end of file From 0d38999072ed9a2ef8a42bea046f444c45d7806e Mon Sep 17 00:00:00 2001 From: Falko Victor Habel Date: Wed, 2 Apr 2025 12:16:16 +0000 Subject: [PATCH 6/6] setup.py aktualisiert --- setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index baca931..b6c17c3 100644 --- a/setup.py +++ b/setup.py @@ -6,9 +6,14 @@ setup( packages=find_packages(where="src"), package_dir={"": "src"}, install_requires=[ - line.strip() - for line in open("requirements.txt") - if line.strip() and not line.startswith("#") + "torch", + "aiia", + "pillow", + "torchvision", + "scikit-learn", + ], + dependency_links=[ + "git+https://gitea.fabelous.app/Machine-Learning/AIIA.git#egg=aiia" ], python_requires=">=3.10", ) \ No newline at end of file