Skip to content

Dependency installation failure #6

Open

Description

@YiboZhao624

Dear authors,

Thank you for your excellent work. While reproducing your code, I encountered the following issues:

  1. The trust_align folder under the main branch appears to be missing the environment.yml file, which makes it impossible to set up the environment following the README in that directory. After referring to issue conda env create -f environment.yaml #1 and retrieving the corresponding file from the release branch, I added it manually. However, even after configuring the huggingface/alignhandbook environment as described in the README, there are still version conflicts:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
torchaudio 2.3.0 requires torch==2.3.0, but you have torch 2.9.0 which is incompatible.
torchvision 0.18.0 requires torch==2.3.0, but you have torch 2.9.0 which is incompatible.
vllm 0.5.1 requires torch==2.3.0, but you have torch 2.9.0 which is incompatible.
vllm-flash-attn 2.5.9 requires torch==2.3.0, but you have torch 2.9.0 which is incompatible.
xformers 0.0.26.post1 requires torch==2.3.0, but you have torch 2.9.0 which is incompatible.
  1. When running the code, I encountered the following error:
    ModuleNotFoundError: Could not import module 'PreTrainedModel'. Are this object's requirements defined correctly?
    This module has been removed since transformers==4.36. I therefore downgraded transformers to 4.35.2, but then encountered another error:
    cannot import name 'is_rich_available' from 'transformers.utils'.
    I suspect this might be caused by an incompatibility between transformers and alignmenthandbook.

I would greatly appreciate any guidance or clarification you could provide to help resolve these issues.

Best regards,
Yibo

Activity

  1. YiboZhao624 commented on Nov 18, 2025

    @YiboZhao624
    Author

    The requirements.txt file in the trust_align folder appears to have been generated directly via pip freeze and contains a large number of packages that could potentially disrupt the existing environment of anyone installing them. It seems that significant cleaning is needed to make it a proper requirements file suitable for other developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions