Skip to content

Python Module 调用失败 #14

@suifei

Description

@suifei

Macbook M1 pro 16G

编译成功

cmake -B build 成功
cmake --build build -j 成功
python convert.py -i ~/models/THUDM/chatglm2-6b -t f16 -o chatglm2-ggml-f16.bin 成功
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████| 7/7 [00:08<00:00,  1.28s/it]
Dumping model state: 100%|██████████████████████████████████████████████████████████████████████| 199/199 [00:35<00:00,  5.66it/s]

运行测试成功

./build/bin/main -m chatglm2-ggml-f16.bin -i
    ________          __  ________    __  ___
   / ____/ /_  ____ _/ /_/ ____/ /   /  |/  /_________  ____
  / /   / __ \/ __ `/ __/ / __/ /   / /|_/ // ___/ __ \/ __ \
 / /___/ / / / /_/ / /_/ /_/ / /___/ /  / // /__/ /_/ / /_/ /
 \____/_/ /_/\__,_/\__/\____/_____/_/  /_(_)___/ .___/ .___/
                                              /_/   /_/
Prompt   > 你好!
ChatGLM2 > 你好👋!我是人工智能助手 ChatGLM2-6B,很高兴见到你,欢迎问我任何问题。

成功速度很快

Python Binding 有问题

pip install .
.....
Successfully built chatglm-cpp
Installing collected packages: chatglm-cpp
Successfully installed chatglm-cpp-0.2.0

运行 web_demo.py 失败

python web_demo.py -m chatglm2-ggml-f16.bin
Traceback (most recent call last):
  File "/Users/suifei/works/chatglm.cpp/web_demo.py", line 5, in <module>
    import chatglm_cpp
  File "/Users/suifei/works/chatglm.cpp/chatglm_cpp/__init__.py", line 5, in <module>
    import chatglm_cpp._C as _C
ModuleNotFoundError: No module named 'chatglm_cpp._C'

请问下这个是什么原因导致的,python module 调用失败


System environment

Apple M1 Pro 16 GB macOS(13.4.1 (22F82))

The compilation was successful

cmake -B build #Success
cmake --build build -j #Success
python convert.py -i ~/models/THUDM/chatglm2-6b -t f16 -o chatglm2-ggml-f16.bin #Success
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████| 7/7 [00:08<00:00,  1.28s/it]
Dumping model state: 100%|██████████████████████████████████████████████████████████████████████| 199/199 [00:35<00:00,  5.66it/s]

The test was successful

./build/bin/main -m chatglm2-ggml-f16.bin -i
    ________          __  ________    __  ___
   / ____/ /_  ____ _/ /_/ ____/ /   /  |/  /_________  ____
  / /   / __ \/ __ `/ __/ / __/ /   / /|_/ // ___/ __ \/ __ \
 / /___/ / / / /_/ / /_/ /_/ / /___/ /  / // /__/ /_/ / /_/ /
 \____/_/ /_/\__,_/\__/\____/_____/_/  /_(_)___/ .___/ .___/
                                              /_/   /_/
Prompt   > hello!
ChatGLM2 > Hello! How can I assist you today?

The success rate is fast.

To install the Python binding from source, run:

pip install .
.....
Successfully built chatglm-cpp
Installing collected packages: chatglm-cpp
Successfully installed chatglm-cpp-0.2.0

An error occurred while running web_demo.py.

python web_demo.py -m chatglm2-ggml-f16.bin
Traceback (most recent call last):
  File "/Users/suifei/works/chatglm.cpp/web_demo.py", line 5, in <module>
    import chatglm_cpp
  File "/Users/suifei/works/chatglm.cpp/chatglm_cpp/__init__.py", line 5, in <module>
    import chatglm_cpp._C as _C
ModuleNotFoundError: No module named 'chatglm_cpp._C'

What is the reason for the failure of the Python module call?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions