From a1b454fc43fac59fa1b85cc80c5e7f4769c7928b Mon Sep 17 00:00:00 2001 From: bones-zhu <61820323+bones-zhu@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:09:33 +0800 Subject: [PATCH 1/3] Update model_config.py fix type --- configs/model_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/model_config.py b/configs/model_config.py index ea24c36..dbb7bce 100644 --- a/configs/model_config.py +++ b/configs/model_config.py @@ -220,7 +220,7 @@ STREAMING = True # Use p-tuning-v2 PrefixEncoder USE_PTUNING_V2 = False -PTUNING_DIR='./ptuing-v2' +PTUNING_DIR='./ptuning-v2' # LLM running device LLM_DEVICE = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu" From e2eaefc999e9dfaabea57076f4e7bff2555c3d29 Mon Sep 17 00:00:00 2001 From: bones-zhu <61820323+bones-zhu@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:10:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Update=20model=5Fconfig.py=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=BB=98=E8=AE=A4=E7=9A=84LLM=5FMODEL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/model_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/model_config.py b/configs/model_config.py index dbb7bce..4a51c5c 100644 --- a/configs/model_config.py +++ b/configs/model_config.py @@ -203,7 +203,7 @@ llm_model_dict = { } # LLM 名称 -LLM_MODEL = "fastchat-chatglm-6b-int4" +LLM_MODEL = "fastchat-chatglm" # 量化加载8bit 模型 LOAD_IN_8BIT = False # Load the model with bfloat16 precision. Requires NVIDIA Ampere GPU. From 5479a74789542a8fc5082bf2a55dc96240595c04 Mon Sep 17 00:00:00 2001 From: bones-zhu <61820323+bones-zhu@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:11:51 +0800 Subject: [PATCH 3/3] Update chatglm_llm.py remove unused library --- models/chatglm_llm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/chatglm_llm.py b/models/chatglm_llm.py index 81878ce..0d19ee6 100644 --- a/models/chatglm_llm.py +++ b/models/chatglm_llm.py @@ -2,14 +2,14 @@ from abc import ABC from langchain.chains.base import Chain from typing import Any, Dict, List, Optional, Generator from langchain.callbacks.manager import CallbackManagerForChainRun -from transformers.generation.logits_process import LogitsProcessor -from transformers.generation.utils import LogitsProcessorList, StoppingCriteriaList +# from transformers.generation.logits_process import LogitsProcessor +# from transformers.generation.utils import LogitsProcessorList, StoppingCriteriaList from models.loader import LoaderCheckPoint from models.base import (BaseAnswer, AnswerResult, AnswerResultStream, AnswerResultQueueSentinelTokenListenerQueue) -import torch +# import torch import transformers