Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于macOS #75

Closed
Raphtalia-chann opened this issue Mar 15, 2023 · 1 comment
Closed

关于macOS #75

Raphtalia-chann opened this issue Mar 15, 2023 · 1 comment

Comments

@Raphtalia-chann
Copy link

macOS运行报错未知平台解决方法:

  1. 修改web_demo.py/cli_demo.py
    model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).float()
  2. 既然报错sys.platform,那就干脆把linux改成识别到的darwin,反正都是类unix
    修改/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cpm_kernels/library/base.py(具体路径因人而异)

2A537A26F29BD14B735F4C00DE058FB8

添加elif darwin:

截屏2023-03-15 22 05 56

    elif sys.platform.startswith("darwin"):
        lib_path = unix_find_lib(self.__name)
        self.__lib_path = lib_path
        if lib_path is not None:
            self.__lib = ctypes.cdll.LoadLibrary(lib_path)

最终效果双击运行:
截屏2023-03-15 22 08 22

@duzx16
Copy link
Member

duzx16 commented Mar 15, 2023

谢谢你提供的方法。在#6 (comment) 中我给出了报错的原因和解决方法。其实只要先把仓库clone的本地就可以了。

@duzx16 duzx16 closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants