Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
scutcyr authored Jun 6, 2023
1 parent 7774613 commit 0627abc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ model = AutoModel.from_pretrained(model_name_or_path, trust_remote_code=True).ha
model.to(device)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)

# 调用模型的chat函数
i
# 单轮对话调用模型的chat函数
user_input = "我失恋了,好难受!"
input_text = "用户:" + user_input + "\n心理咨询师:"
response, history = model.chat(tokenizer, query=input_text, history=None, max_length=2048, num_beams=1, do_sample=True, top_p=0.75, temperature=0.95, logits_processor=None)

```





* 启动服务
本项目提供了[soulchat_app.py](./soulchat_app.py)作为SoulChat模型的使用示例,通过以下命令即可开启服务,然后,通过http://<your_ip>:9026访问。
```bash
Expand Down

0 comments on commit 0627abc

Please sign in to comment.