This commit is contained in:
hackrobot
2024-08-03 16:42:42 +08:00
parent 5bcc3a51fd
commit d5aeccc0b7
8 changed files with 8 additions and 118 deletions

View File

@@ -1,10 +0,0 @@
```
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True, device='cuda')
model = model.eval()
response, history = model.chat(tokenizer, "你好", history=[])
rint(response)
response, history = model.chat(tokenizer, "晚上睡不着应该怎么办", history=history)
print(response)
```

View File

@@ -46,8 +46,4 @@ python示例文档
[短信 Python SDK-SDK 文档-文档中心-腾讯云](https://cloud.tencent.com/document/product/382/43196)
需要根据返回的id,轮询更新结果