Skip to content

[BUG] Cannot import name 'convert_file_size_to_int' from 'transformers.utils.hub'  #123

Description

@wqw547243068

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

kaggle 默认环境下执行官方示例代码

错误信息:

ImportError: cannot import name 'convert_file_size_to_int' from 'transformers.utils.hub' (/opt/conda/lib/python3.7/site-packages/transformers/utils/hub.py)

Expected Behavior

No response

Steps To Reproduce

env:

  • pip install protobuf==3.20.0 transformers==4.26.1 icetk cpm_kernels
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
response, history = model.chat(tokenizer, "你好", history=[])
print(response)
response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history)
print(response)

Environment

- OS:
- Python: 3.7.12
- Transformers: 4.26.1
- PyTorch: 1.11.0
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) : true

Anything else?

No response

Activity

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