提交 57d4d0a2 作者: imClumsyPanda

update chatglm_llm.py

上级 8db6cd51
import json import json
from langchain.llms.base import LLM from langchain.llms.base import LLM
from typing import Optional, List from typing import List, Dict, Optional
from langchain.llms.utils import enforce_stop_tokens
from transformers import AutoTokenizer, AutoModel, AutoConfig from transformers import AutoTokenizer, AutoModel, AutoConfig
import torch import torch
from configs.model_config import * from configs.model_config import *
from langchain.callbacks.base import CallbackManager
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from typing import Dict, Tuple, Union, Optional
from utils import torch_gc from utils import torch_gc
DEVICE_ = LLM_DEVICE DEVICE_ = LLM_DEVICE
...@@ -53,7 +49,6 @@ class ChatGLM(LLM): ...@@ -53,7 +49,6 @@ class ChatGLM(LLM):
tokenizer: object = None tokenizer: object = None
model: object = None model: object = None
history_len: int = 10 history_len: int = 10
callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
def __init__(self): def __init__(self):
super().__init__() super().__init__()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论