Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
nomagick /chatglm2-6b:875eba1b
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run nomagick/chatglm2-6b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"nomagick/chatglm2-6b:875eba1b80de7170c1317cb5a130c60dae8d479a833ee0b5530fad0920a5f167",
{
input: {
top_p: 0.8,
prompt: "[Round 1]\n\n问:你好\n\n答:你好👋!我是人工智能助手 ChatGLM2-6B,很高兴见到你,欢迎问我任何问题。\n\n[Round 2]\n\n问:早上起不来应该怎么办\n\n答:",
max_tokens: 2048,
temperature: 0.75
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run nomagick/chatglm2-6b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nomagick/chatglm2-6b:875eba1b80de7170c1317cb5a130c60dae8d479a833ee0b5530fad0920a5f167",
input={
"top_p": 0.8,
"prompt": "[Round 1]\n\n问:你好\n\n答:你好👋!我是人工智能助手 ChatGLM2-6B,很高兴见到你,欢迎问我任何问题。\n\n[Round 2]\n\n问:早上起不来应该怎么办\n\n答:",
"max_tokens": 2048,
"temperature": 0.75
}
)
# The nomagick/chatglm2-6b model can stream output as it's running.
# The predict method returns an iterator, and you can iterate over that output.
for item in output:
# https://replicate.com/nomagick/chatglm2-6b/api#output-schema
print(item, end="")
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run nomagick/chatglm2-6b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "nomagick/chatglm2-6b:875eba1b80de7170c1317cb5a130c60dae8d479a833ee0b5530fad0920a5f167",
"input": {
"top_p": 0.8,
"prompt": "[Round 1]\\n\\n问:你好\\n\\n答:你好👋!我是人工智能助手 ChatGLM2-6B,很高兴见到你,欢迎问我任何问题。\\n\\n[Round 2]\\n\\n问:早上起不来应该怎么办\\n\\n答:",
"max_tokens": 2048,
"temperature": 0.75
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-07-02T02:13:48.764861Z",
"created_at": "2023-07-02T02:09:01.723459Z",
"data_removed": false,
"error": null,
"id": "qolre4dbhlydmtguu6vnd3ansa",
"input": {
"top_p": 0.8,
"prompt": "[Round 1]\n\n问:你好\n\n答:你好👋!我是人工智能助手 ChatGLM2-6B,很高兴见到你,欢迎问我任何问题。\n\n[Round 2]\n\n问:早上起不来应该怎么办\n\n答:",
"max_tokens": 2048,
"temperature": 0.75
},
"logs": null,
"metrics": {
"predict_time": 6.051273,
"total_time": 287.041402
},
"output": [
"如果",
"出现",
"早上",
"起",
"不",
"来的",
"情况",
",",
"可以",
"尝试",
"一些",
"方法",
"来",
"调整",
"自己的",
"作息",
"时间",
"和生活",
"方式",
",",
"从而",
"更好地",
"适应",
"早起",
"。",
"具体",
"如下",
":",
"\n",
"\n",
"1",
".",
" ",
"建立",
"规律",
"的",
"作息",
"时间",
":",
"每天",
"固定的",
"睡眠",
"时间",
"、",
"固定的",
"起床",
"时间和",
"固定的",
"作息",
"时间表",
",",
"可以帮助",
"身体",
"适应",
"并",
"建立",
"规律",
"的",
"生物",
"钟",
"。",
"\n",
"\n",
"2",
".",
" ",
"制定",
"一个",
"合理的",
"早起",
"计划",
":",
"逐渐",
"适应",
"早起",
"的过程",
",",
"每天",
"比",
"前一天",
"早",
"睡",
"早起",
"1",
"5",
"分钟左右",
",",
"直到",
"达到",
"想要的",
"早起",
"时间",
"。",
"\n",
"\n",
"3",
".",
" ",
"制定",
"一个",
"有",
"意义的",
"早起",
"计划",
":",
"制定",
"一个",
"计划",
"表",
",",
"列出",
"自己",
"需要",
"完成的",
"任务",
",",
"并",
"设定",
"奖励",
"措施",
",",
"例如",
"完成",
"任务",
"后",
"给自己",
"一个小",
"奖励",
"。",
"\n",
"\n",
"4",
".",
" ",
"建立",
"一个",
"健康",
"的生活",
"习惯",
":",
"保持",
"良好的",
"生活习惯",
",",
"如",
"合理的",
"饮食",
"、",
"适量的",
"运动",
"和",
"放松",
"等",
",",
"可以帮助",
"自己",
"更好地",
"调整",
"自己的",
"生物",
"钟",
",",
"更容易",
"早起",
"。",
"\n",
"\n",
"5",
".",
" ",
"制定",
"一个",
"与",
"健康",
"有关的",
"早起",
"计划",
":",
"如果",
"长期",
"处于",
"晚",
"睡",
"晚",
"起",
"的状态",
",",
"建议",
"逐渐",
"调整",
",",
"不要",
"一下子",
"早起",
"太多",
",",
"让自己",
"适应",
"新的",
"作息",
"时间",
"。",
"\n",
"\n",
"希望",
"这些",
"方法",
"可以帮助",
"你",
"解决",
"早",
"起的",
"难题",
"。",
""
],
"started_at": "2023-07-02T02:13:42.713588Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/qolre4dbhlydmtguu6vnd3ansa",
"cancel": "https://api.replicate.com/v1/predictions/qolre4dbhlydmtguu6vnd3ansa/cancel"
},
"version": "875eba1b80de7170c1317cb5a130c60dae8d479a833ee0b5530fad0920a5f167"
}