chatglm.cpp
chatglm.cpp copied to clipboard
C++ implementation of ChatGLM-6B & ChatGLM2-6B & ChatGLM3 & GLM4(V)
有人知道量化为q4_1之后的chatglm3-6b-32k模型的单次最大回复值的tokens值是多少吗? 我看阿里云里面写的chatglm3:支持输入输出token合计是7500,其中单轮最大输出token为1500,单轮最大输入token为6000 但我实际测试时发现好像最多只能生成500-600tokens,是因为我环境的问题吗? [https://help.aliyun.com/zh/dashscope/developer-reference/api-details-8](url)
环境:win11 硬件:i9 4060 环境为conda管理虚拟环境。 模型使用的是量化后的chatGLM3-6B-int4模型。 编译命令:cmake -B build -DGGML_CUBLAS=ON -DCUDA_ARCHITECTURES="89" -DCMAKE_CUDA_COMPILER="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3\bin\nvcc.exe" -DCMAKE_GENERATOR_TOOLSET="cuda=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3" ; cmake --build build -j --config Release 编译后无报错。 cd到example文件夹(直接在chatglm_cpp主目录下调用会报错),使用$env:MODEL="D:\langchain_GLM3_connection\chatglm.cpp\chatglm3-ggml.bin"; uvicorn...
机器配置i7-12700F,3060显卡12GB显存,64GB 内存。
 出现错误: ./build/bin/main: error while loading shared libraries: libggml.so: cannot open shared object file: No such file or directory
整了好久,终于转换好了,给大家说说容易踩坑的几个点 我的系统:Arch Linux x86_64 1.clone时一定要带`--recursive`,不然编译时会报错 2.CPU转换时torch不必安装CPU版本 3.transformers安装时务必指定版本`transformers==4.33.2`,新版transformers更改了 一些函数,会报错 4.若要转换Q4_0,请务必使用THUDM/chatglm-6b-int4,否则终端会直接崩掉 5.最重要的一点!!!一定要把chatglm_cpp/convert.py里的 ```py model = auto_model_class.from_pretrained(model_name_or_path, trust_remote_code=True, low_cpu_mem_usage=True) ``` 这一行改成 ```py model = auto_model_class.from_pretrained(model_name_or_path, trust_remote_code=True).float() ``` 我因为这个卡了很久,一定要注意!!!
如题,就是单纯想保存会话记录,不需要我每一次启动,都告诉他一大把东西。
`CMake Error in third_party/sentencepiece/src/CMakeLists.txt: Target "sentencepiece-static" requires the language dialect "CXX17" (with compiler extensions), but CMake does not know the compile flags to use to enable it.` 环境是Red Hat 9.3.1-2,cmake3...
2024-03-07 10:16:11,727 - openai_api - INFO - prompt: "hi", sync response: "" double free or corruption (out) Aborted (core dumped)
如何支持amd硬件
看了以下代码,是 Pipeline 类里的 std::unique_ptr mapped_file; 设置到成员变量后,会一直持有模型权重文件。 在CPU模式下,这样做没啥问题,但用gpu做后台运行的,还是很希望能把这部分资源给释放了。