We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@st.cache_resource def get_model(): tokenizer = AutoTokenizer.from_pretrained("chatglm2-6b", trust_remote_code=True) model = AutoModel.from_pretrained("chatglm2-6b", trust_remote_code=True).cuda() model = PeftModel.from_pretrained(model, "weights/sentiment_comp_ie_chatglm2").half() # 多显卡支持,使用下面两行代替上面一行,将num_gpus改为你实际的显卡数量 # from utils import load_model_on_gpus # model = load_model_on_gpus("chatglm2-6b", num_gpus=2) model = model.eval() return tokenizer, model
The text was updated successfully, but these errors were encountered:
No branches or pull requests
@st.cache_resource
def get_model():
tokenizer = AutoTokenizer.from_pretrained("chatglm2-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("chatglm2-6b", trust_remote_code=True).cuda()
model = PeftModel.from_pretrained(model, "weights/sentiment_comp_ie_chatglm2").half()
# 多显卡支持,使用下面两行代替上面一行,将num_gpus改为你实际的显卡数量
# from utils import load_model_on_gpus
# model = load_model_on_gpus("chatglm2-6b", num_gpus=2)
model = model.eval()
return tokenizer, model
The text was updated successfully, but these errors were encountered: