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-int4:ea3715b3
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-int4 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-int4:ea3715b3c4561f1e7c2a7db5873cf9831a7a6c56a6910f7276d17e56b08ef4a9",
{
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-int4 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nomagick/chatglm2-6b-int4:ea3715b3c4561f1e7c2a7db5873cf9831a7a6c56a6910f7276d17e56b08ef4a9",
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-int4 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-int4/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-int4 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": "ea3715b3c4561f1e7c2a7db5873cf9831a7a6c56a6910f7276d17e56b08ef4a9",
"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-12T15:46:59.257976Z",
"created_at": "2023-07-12T15:46:22.901535Z",
"data_removed": false,
"error": null,
"id": "cddml4jbn2pihpzk7zs34q5oai",
"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": 36.383586,
"total_time": 36.356441
},
"output": [
"以下",
"是一些",
"有助于",
"睡眠",
"的",
"技巧",
":",
"\n",
"\n",
"1",
".",
" ",
"改善",
"睡眠",
"环境",
":",
"确保",
"睡眠",
"环境",
"安静",
"、",
"舒适",
"、",
"凉",
"爽",
"和",
"黑暗",
"。",
"睡前",
"可以使用",
"黑暗",
"窗",
"帘",
"、",
"睡眠",
"面",
"罩",
"、",
"白",
"噪声",
"机",
"等",
"帮助",
"创造",
"良好的",
"睡眠",
"环境",
"。",
"\n",
"\n",
"2",
".",
" ",
"放松",
"身心",
":",
"使用",
"放松",
"技巧",
",",
"如",
"冥想",
"、",
"深",
"呼吸",
"、",
"瑜伽",
"、",
"按摩",
"等",
",",
"缓解",
"紧张",
"和",
"压力",
",",
"帮助",
"入睡",
"。",
"\n",
"\n",
"3",
".",
" ",
"规律",
"作息",
":",
"保持",
"规律",
"的",
"睡眠",
"时间表",
",",
"每天",
"在",
"相同",
"的时间",
"上",
"床",
"睡觉",
"和",
"起床",
"。",
"帮助",
"身体",
"建立",
"健康的",
"生物",
"钟",
",",
"提高",
"睡眠",
"质量",
"。",
"\n",
"\n",
"4",
".",
" ",
"避免",
"刺激",
":",
"避免",
"在",
"睡前",
"使用",
"电子",
"设备",
",",
"如",
"手机",
"、",
"电脑",
"、",
"平板",
"等",
"。",
"这些",
"设备",
"发出的",
"蓝",
"光",
"会",
"干扰",
"睡眠",
"。",
"\n",
"\n",
"5",
".",
" ",
"限制",
"咖啡",
"因",
"和",
"酒精",
":",
"避免",
"在",
"睡前",
"数",
"小时内",
"摄入",
"咖啡",
"因",
"和",
"酒精",
"。",
"这些",
"物质",
"会影响",
"睡眠",
"质量",
"。",
"\n",
"\n",
"6",
".",
" ",
"锻炼",
"身体",
":",
"适",
"度的",
"身体",
"锻炼",
"可以帮助",
"入睡",
",",
"但要",
"避免",
"在",
"睡前",
"进行",
"剧",
"烈的",
"运动",
"。",
"\n",
"\n",
"如果",
"这些",
"技巧",
"不能",
"解决",
"你的",
"问题",
",",
"可以",
"考虑",
"咨询",
"医生",
"或",
"睡眠",
"专家",
"以",
"获取",
"更多的",
"帮助",
"。",
""
],
"started_at": "2023-07-12T15:46:22.874390Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/cddml4jbn2pihpzk7zs34q5oai",
"cancel": "https://api.replicate.com/v1/predictions/cddml4jbn2pihpzk7zs34q5oai/cancel"
},
"version": "ea3715b3c4561f1e7c2a7db5873cf9831a7a6c56a6910f7276d17e56b08ef4a9"
}