gpt j chatbot
1.0.0
此模板的目的是为希望构建 AI 驱动的个性化角色的其他开发人员提供快速入门指南
Jeanie 是基于此存储库的 GPT-J 支持的虚拟女友
git clone [email protected]:machaao/gpt-j-chatbot.git
cd gpt-j-chatbot
pip install -r requirements.txt
nano -w .env
API_TOKEN =
BASE_URL = ex: https://ganglia.machaao.com
NAME = ex: Jess
DASHBOT_KEY = (Optional) (Conversational Analytics)
MODEL_NAME=EleutherAI/gpt-neo-1.3B # for local inference / testing [we recommend using GPT-NEO 1.3B for 16GB ram - load can take up to 1 min and inference avg is about 10 - 20 seconds] See https://huggingface.co/EleutherAI for additional models
NLP_CLOUD_TOKEN = # for faster remote inference
# BOT PARAMS - Unset Parameters would use their default values.
# Don't use Top_p and Temperature parameters simultaneously.
# Default Values are mentioned below.
# The higher this value, the less deterministic the result will be
TOP_P="1.0"
# The higher this value, the less deterministic the result will be
TEMPERATURE="0.8"
# The lower this value, the less likely GPT-J is going to generate off-topic text
TOP_K="50"
# The maximum number of tokens that the generated text should contain
MAX_LENGTH="50"
为了更好地理解上述 GPT-J 参数,请查看 nlpcloud.io 文档
API_TOKEN
条目下的.env
文件中.env
文件中的NLP_CLOUD_TOKEN
条目下.env
文件中的DASHBOT_KEY
条目下 bot_name is a very understanding girl
bot_name and stranger are seeing each other
Here is a recent discussion between stranger and bot_name
###
stranger: hi
bot_name: hello there
def core(self, req: str, user_id: str):
python app.py
ngrok http 5000
使用如下所示提供的 URL 更新 MessengerX.io Portal 上的机器人 Webhook URL,以继续开发
If you use [Ngrok.io](https://ngrok.io), your webhook URL would be of the format as in the example below
https://1234-115-187-40-104.ngrok.io/machaao/hook
访问: https://messengerx.io/
我们假设您有权访问 heroku 帐户并为您的操作系统安装了 heroku 命令行客户端。
heroku login
heroku create
git commit -m ".env updated"
git push heroku master
heroku logs --tail
使用 heroku 应用程序 URL 更新 MessengerX.io 门户上的机器人 Webhook URL
Webhook Url: /machaao/hook
访问: https://messengerx.io/
Tips for MPS on Mac [Use Nightly Build]
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu