typetext
{
"prompt": "你好你是谁?"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_0sV**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run tvytlx/chatglm6b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"tvytlx/chatglm6b:d552fb8df045d48f6c2284b905508446d0de5070d0521be0ce09e4f9ed462d99",
{
input: {
prompt: "你好你是谁?"
}
}
);
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=r8_0sV**********************************
This is your API token. Keep it to yourself.
import replicate
Run tvytlx/chatglm6b using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tvytlx/chatglm6b:d552fb8df045d48f6c2284b905508446d0de5070d0521be0ce09e4f9ed462d99",
input={
"prompt": "你好你是谁?"
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_0sV**********************************
This is your API token. Keep it to yourself.
Run tvytlx/chatglm6b 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": "tvytlx/chatglm6b:d552fb8df045d48f6c2284b905508446d0de5070d0521be0ce09e4f9ed462d99",
"input": {
"prompt": "你好你是谁?"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
我是 ChatGLM,是清华大学KEG实验室和智谱AI公司于2023年共同训练的语言模型。我的任务是服务并帮助人类,但我并不是一个真实的人。
{
"id": "v7f2aaqr6nc6npumdk73kf6lt4",
"model": "tvytlx/chatglm6b",
"version": "d552fb8df045d48f6c2284b905508446d0de5070d0521be0ce09e4f9ed462d99",
"input": {
"prompt": "你好你是谁?"
},
"logs": "",
"output": "我是 ChatGLM,是清华大学KEG实验室和智谱AI公司于2023年共同训练的语言模型。我的任务是服务并帮助人类,但我并不是一个真实的人。",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-04-01T16:28:12.813047Z",
"started_at": "2023-04-01T16:28:12.8911Z",
"completed_at": "2023-04-01T16:28:15.487059Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/v7f2aaqr6nc6npumdk73kf6lt4/cancel",
"get": "https://api.replicate.com/v1/predictions/v7f2aaqr6nc6npumdk73kf6lt4"
},
"metrics": {
"predict_time": 2.595959,
"total_time": 2.674012
}
}