Closed gougouzcm closed 3 months ago
I've gotten it to run on Python 3.10 (xformers and its dependencies don't seem to build on later versions). It seems as though bitsandbytes through conda builds without GPU support, so I wound up using pip.
conda create -n <env> python=3.10
conda activate <env>
pip install einops triton
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
conda install xformers/label/dev::xformers
conda install conda-forge::transformers
conda install conda-forge::accelerate
pip install bitsandbytes
I've gotten it to run on Python 3.10 (xformers and its dependencies don't seem to build on later versions). It seems as though bitsandbytes through conda builds without GPU support, so I wound up using pip.
conda create -n <env> python=3.10 conda activate <env> pip install einops triton conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia conda install xformers/label/dev::xformers conda install conda-forge::transformers conda install conda-forge::accelerate pip install bitsandbytes
Run the command you provided
conda create -n <env> python=3.10
conda activate <env>
pip install einops triton
still got a error,
ERROR: Could not find a version that satisfies the requirement triton (from versions: none) ERROR: No matching distribution found for triton
it seems triton can not be installed on windows. I notice that all the version of triton contains linux pytorch_triton-2.3.0-cp312-cp312-linux_x86_64.whl
需要使用Linux 系统进行运行,windows无法安装这个包
System Info / 系統信息
cuda 12.3 transformers 4.41.1 python 3.11.9 win10 4070
conda create -n my_CogVLM2-3.11.9 python=3.11.9 conda activate my_CogVLM2-3.11.9
运行完 pip install -r requirements.txt 返回
MarkupSafe-2.1.5 aiofiles-23.2.1 annotated-types-0.7.0 anyio-3.7.1 asyncer-0.0.2 bidict-0.23.1 bitsandbytes-0.43.1 certifi-2024.2.2 chainlit-1.1.202 charset-normalizer-3.3.2 chevron-0.14.0 click-8. 1.7 colorama-0.4.6 dataclasses_json-0.5.14 deprecated-1.2.14 distro-1.9.0 einops-0.8.0 fastapi-0.110.3 fastapi-socketio-0.0.10 filelock-3.14.0 filetype-1.2.0 fsspec-2024.5.0 googleapis-common-protos-1.63.0 grpcio-1.64.0 h11-0.14.0 httpcore-1.0.5 httpx-0.27.0 huggingface-hub-0.23.1 idna-3.7 importlib-metadata-7.0.0 intel-openmp-2021.4.0 jinja2-3.1.4 lazify-0.4.0 literalai-0.0.601 loguru-0.7.2 marshmallow-3.21.2 mkl-2021.4.0 mpmath-1.3.0 mypy-extensions-1.0.0 nest-asyncio-1.6.0 networkx-3.3 numpy-1.26.4 openai-1.30.3 opentelemetry-api-1.24.0 opentelemetry-exporter-otlp-1.24.0 opentelemetry-exporter-otlp-proto-common-1.24.0 opentelemetry-exporter-otlp-pro to-grpc-1.24.0 opentelemetry-exporter-otlp-proto-http-1.24.0 opentelemetry-instrumentation-0.45b0 opentelemetry-proto-1.24.0 opentelemetry-sdk-1.24.0 opentelemetry-semantic-conventions-0.45b0 packaging-23.2 pillow-10.3.0 protobuf-4.25.3 pydantic-2.7.1 pydantic-core-2.18.2 pyjwt-2.8.0 python-dotenv-1.0.1 python-engineio-4.9.1 python-multipart-0.0.9 python-socketio-5.11.2 pyyaml-6.0.1 regex-2024.5.15 requests-2.32.2 safetensors-0.4.3 simp le-websocket-1.0.0 sniffio-1.3.1 sse-starlette-2.1.0 starlette-0.37.2 sympy-1.12 syncer-2.0.3 tbb-2021.12.0 timm-1.0.3 tokenizers-0.19.1 tomli-2.0.1 torch-2.3.0 torchvision-0.18.0 tqdm-4.66.4 transformers-4.41.1 typing-e xtensions-4.12.0 typing-inspect-0.9.0 uptrace-1.24.0 urllib3-2.2.1 uvicorn-0.25.0 watchfiles-0.20.0 win32-setctime-1.1.0 wrapt-1.16.0 wsproto-1.2.0 xformers-0.0.26.post1 zipp-3.18.2
按照文档运行 python cli_demo.py 报错如下
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. Traceback (most recent call last): File "F:\workspace\ai\CogVLM2\basic_demo\cli_demo.py", line 21, in <module> model = AutoModelForCausalLM.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\workSoftInstallPath\anaconda3\envs\my_cogvlm2-3.11.9\Lib\site-packages\transformers\models\auto\auto_factory.py", line 550, in from_pretrained model_class = get_class_from_dynamic_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\workSoftInstallPath\anaconda3\envs\my_cogvlm2-3.11.9\Lib\site-packages\transformers\dynamic_module_utils.py", line 498, in get_class_from_dynamic_module final_module = get_cached_module_file( ^^^^^^^^^^^^^^^^^^^^^^^ File "F:\workSoftInstallPath\anaconda3\envs\my_cogvlm2-3.11.9\Lib\site-packages\transformers\dynamic_module_utils.py", line 361, in get_cached_module_file get_cached_module_file( File "F:\workSoftInstallPath\anaconda3\envs\my_cogvlm2-3.11.9\Lib\site-packages\transformers\dynamic_module_utils.py", line 323, in get_cached_module_file modules_needed = check_imports(resolved_module_file) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\workSoftInstallPath\anaconda3\envs\my_cogvlm2-3.11.9\Lib\site-packages\transformers\dynamic_module_utils.py", line 181, in check_imports raise ImportError( ImportError: This modeling file requires the following packages that were not found in your environment: triton. Run pip install triton
单独运行 pip install triton,总是提示ERROR: Could not find a version that satisfies the requirement triton (from versions: none) ERROR: No matching distribution found for triton
换了 python 版本也不行
Who can help? / 谁可以帮助到您?
No response
Information / 问题信息
Reproduction / 复现过程
conda create -n my_CogVLM2-3.11.9 python=3.11.9 conda activate my_CogVLM2-3.11.9 pip install -r requirements.txt python cli_demo.py
Expected behavior / 期待表现
正常运行