format code

This commit is contained in:
sheri528 2023-06-13 14:22:55 +08:00
parent a88e8aa51b
commit 5da4b38964
2 changed files with 5 additions and 3 deletions

View File

@ -93,8 +93,8 @@ class ChatGLMAdapater(BaseLLMAdaper):
AutoModel.from_pretrained(
model_path, trust_remote_code=True, **from_pretrained_kwargs
)
.half()
.cuda()
.half()
.cuda()
)
return model, tokenizer

View File

@ -73,7 +73,9 @@ class ModelWorker:
for output in self.generate_stream_func(
self.model, self.tokenizer, params, DEVICE, CFG.MAX_POSITION_EMBEDDINGS
):
# 生产请不要打开输出gpt4all线程与父进程共享stdout 打开会影响前端输出
# Please do not open the output in production!
# The gpt4all thread shares stdout with the parent process,
# and opening it may affect the frontend output.
# print("output: ", output)
ret = {
"text": output,