Giter Site home page Giter Site logo

Comments (3)

alitrack avatar alitrack commented on May 17, 2024 2

把模型下载到本地,

brew install git-lfs
git lfs install
git clone https://huggingface.co/baichuan-inc/Baichuan-13B-Chat

如果网络问题,可以收工下载模型文件

GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/baichuan-inc/Baichuan-13B-Chat

模型使用本地路径
使用mps加速model = model.to('mps')
量化不支持Mac,暂时无解
不管cl_demo.py 还是web_demo.py 都如下修改,

pretrained_model_name = "./model/Baichuan-13B-Chat/"

st.set_page_config(page_title="Baichuan-13B-Chat")
st.title("Baichuan-13B-Chat")


@st.cache_resource
def init_model():
    model = AutoModelForCausalLM.from_pretrained(
        pretrained_model_name,
        torch_dtype=torch.float16,
        # device_map="auto",
        trust_remote_code=True
    )
    model = model.to('mps')
    model.generation_config = GenerationConfig.from_pretrained(
        pretrained_model_name
    )
    tokenizer = AutoTokenizer.from_pretrained(
        pretrained_model_name,
        use_fast=False,
        trust_remote_code=True
    )
    return model, tokenizer

我的系统是:
MacBook Pro M2 Max(12核CPU, 38核GPU, 32G内存)
使用情况,能跑起来,但没有啥意义,太慢。
内存使用最多超过32G,都使用虚拟内存了。
image

from baichuan-13b.

tankxiaodi avatar tankxiaodi commented on May 17, 2024

感谢楼上兄弟, 我用了你的设置在Mac上成功跑起了,M1 Max + 64G内存速度可以接受。
不过今天看到有人搞了ggml的版本:

https://huggingface.co/xuqinyang/baichuan-13b-chat-ggml-int8

from baichuan-13b.

tain198127 avatar tain198127 commented on May 17, 2024

感谢楼上兄弟, 我用了你的设置在Mac上成功跑起了,M1 Max + 64G内存速度可以接受。 不过今天看到有人搞了ggml的版本:

https://huggingface.co/xuqinyang/baichuan-13b-chat-ggml-int8

does it work well? My mac is mac book m1max 64G, could it work well?

from baichuan-13b.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.