From 1814452728522b84678286c6831396850d22f7e8 Mon Sep 17 00:00:00 2001 From: yurekami Date: Fri, 26 Dec 2025 01:12:49 +0900 Subject: [PATCH] fix: Update PyTorch minimum version to 2.1.0 and improve __init__.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update torch requirement from ==2.0.1 to >=2.1.0 in requirements.txt - Update torch requirement from >=2.0.1 to >=2.1.0 in pyproject.toml - Remove unconditional print statement in janus/__init__.py - Add __version__ = "1.0.0" for version tracking The transformers library requires PyTorch >= 2.1, so the previous torch==2.0.1 pin was causing installation failures as reported in #220. Also removes the print() statement that was polluting stdout when importing the module, replacing it with a comment explaining the collections compatibility patch. Fixes #220 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- janus/__init__.py | 7 ++++--- pyproject.toml | 2 +- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/janus/__init__.py b/janus/__init__.py index 09cc08c..8706e90 100644 --- a/janus/__init__.py +++ b/janus/__init__.py @@ -18,12 +18,13 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# check if python version is above 3.10 +__version__ = "1.0.0" + +# Patch collections module for Python 3.10+ compatibility +# This is needed for some dependencies that use deprecated collections imports import sys if sys.version_info >= (3, 10): - print("Python version is above 3.10, patching the collections module.") - # Monkey patch collections import collections import collections.abc diff --git a/pyproject.toml b/pyproject.toml index 382f829..e4e1e56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ urls = {homepage = "https://github.com/deepseek-ai/Janus"} readme = "README.md" requires-python = ">=3.8" dependencies = [ - "torch>=2.0.1", + "torch>=2.1.0", "transformers>=4.38.2", "timm>=0.9.16", "accelerate", diff --git a/requirements.txt b/requirements.txt index 37ed33c..e2b4063 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -torch==2.0.1 +torch>=2.1.0 transformers>=4.38.2 timm>=0.9.16 accelerate