mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-23 07:13:27 +08:00
loader.py: 模型重载 定义 generatorAnswer 增加 AnswerResultStream 定义generate_with_callback收集器,在每次响应时将队列数据同步到AnswerResult requirements.txt 变更项目依赖
10 lines
339 B
Python
10 lines
339 B
Python
import gc
|
|
import traceback
|
|
import torch
|
|
|
|
# This iterator returns the extensions in the order specified in the command-line
|
|
def iterator():
|
|
state_extensions = {}
|
|
for name in sorted(state_extensions, key=lambda x: state_extensions[x][1]):
|
|
if state_extensions[name][0]:
|
|
yield getattr(extensions, name).script, name |