myccc456
myccc456
每次调用的时候,加一对pair问答就行: messages_input = [] messages_input.append({"role": "user", "content": "从现在开始你的名字只能叫智能机器人,性别男性"}) messages_input.append({"role": "assistant", "content": "好的,我的名字叫智能搭配机器人,男性"}) for msg_obj in request.messages: messages_input.append({"role": msg_obj.role, "content": msg_obj.content})
可以看下 chatGLM2的api,有类似部署方式
用量化模型或提高硬件规格吧
加一句:用中文回答 试试
```python # coding=utf-8 # Implements API for ChatGLM2-6B in OpenAI's format. (https://platform.openai.com/docs/api-reference/chat) # Usage: python openai_api.py # Visit http://localhost:8000/docs for documents. import time import torch import uvicorn from pydantic import...