fix loading chatglm3 (#1937)
* update welcome svg * update welcome message * fix loading chatglm3 --------- Co-authored-by: binary-husky <qingxu.fu@outlook.com> Co-authored-by: binary-husky <96192199+binary-husky@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,7 @@ class GetGLM3Handle(LocalLLMHandle):
|
||||
|
||||
def load_model_and_tokenizer(self):
|
||||
# 🏃♂️🏃♂️🏃♂️ 子进程执行
|
||||
from transformers import AutoModel, AutoTokenizer
|
||||
from transformers import AutoModel, AutoTokenizer, BitsAndBytesConfig
|
||||
import os, glob
|
||||
import os
|
||||
import platform
|
||||
@@ -45,15 +45,13 @@ class GetGLM3Handle(LocalLLMHandle):
|
||||
chatglm_model = AutoModel.from_pretrained(
|
||||
pretrained_model_name_or_path=_model_name_,
|
||||
trust_remote_code=True,
|
||||
device="cuda",
|
||||
load_in_4bit=True,
|
||||
quantization_config=BitsAndBytesConfig(load_in_4bit=True),
|
||||
)
|
||||
elif LOCAL_MODEL_QUANT == "INT8": # INT8
|
||||
chatglm_model = AutoModel.from_pretrained(
|
||||
pretrained_model_name_or_path=_model_name_,
|
||||
trust_remote_code=True,
|
||||
device="cuda",
|
||||
load_in_8bit=True,
|
||||
quantization_config=BitsAndBytesConfig(load_in_8bit=True),
|
||||
)
|
||||
else:
|
||||
chatglm_model = AutoModel.from_pretrained(
|
||||
|
||||
@@ -7,7 +7,7 @@ tiktoken>=0.3.3
|
||||
requests[socks]
|
||||
pydantic==2.5.2
|
||||
protobuf==3.18
|
||||
transformers>=4.27.1
|
||||
transformers>=4.27.1,<4.42
|
||||
scipdf_parser>=0.52
|
||||
anthropic>=0.18.1
|
||||
python-markdown-math
|
||||
|
||||
@@ -8,7 +8,7 @@ class WelcomeMessage {
|
||||
url: "https://github.com/binary-husky/gpt_academic/wiki/%E9%A1%B9%E7%9B%AE%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E",
|
||||
},
|
||||
{
|
||||
title: "Arxiv论文一键翻译",
|
||||
title: "Arxiv论文翻译",
|
||||
content: "无缝切换学术阅读语言,最优英文转中文的学术论文阅读体验。",
|
||||
svg: "file=themes/svg/arxiv.svg",
|
||||
url: "https://www.bilibili.com/video/BV1dz4y1v77A/",
|
||||
@@ -67,6 +67,18 @@ class WelcomeMessage {
|
||||
svg: "file=themes/svg/check.svg",
|
||||
url: "https://github.com/binary-husky/gpt_academic/wiki",
|
||||
},
|
||||
{
|
||||
title: "接入更多新模型",
|
||||
content: "模型迭代日新月异,一起动手接入更多新的在线或本地大模型吧。",
|
||||
svg: "file=themes/svg/box.svg",
|
||||
url: "https://github.com/binary-husky/gpt_academic/blob/master/request_llms/README.md",
|
||||
},
|
||||
{
|
||||
title: "联动VLLM等服务",
|
||||
content: "借助VLLM和OneApi等第三方服务高效地部署和运行大模型。",
|
||||
svg: "file=themes/svg/location.svg",
|
||||
url: "https://github.com/binary-husky/gpt_academic/wiki/如何更便捷地接入one-api",
|
||||
},
|
||||
];
|
||||
this.visible = false;
|
||||
this.max_welcome_card_num = 6;
|
||||
|
||||
Reference in New Issue
Block a user