default<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
请使用英文重复这段话:"为了使模型生成最优输出,当使用 Qwen 时需要使用特定的输入格式(chatml),请按照示例格式组织输入。"<|im_end|>
<|im_start|>assistant
typetext
{
"max_tokens": 2048,
"prompt": "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n<|im_start|>user\n请使用英文重复这段话:\"为了使模型生成最优输出,当使用 Qwen 时需要使用特定的输入格式(chatml),请按照ChatML格式组织输入。\" 之后介绍一下Chat ML格式<|im_end|>\n<|im_start|>assistant\n",
"temperature": 0.75,
"top_p": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_3EP**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run nomagick/qwen-14b-chat using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"nomagick/qwen-14b-chat:f9e1ed25e2073f72ff9a3f46545d909b1078e674da543e791dec79218072ae70",
{
input: {
max_tokens: 2048,
prompt: "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n<|im_start|>user\n请使用英文重复这段话:\"为了使模型生成最优输出,当使用 Qwen 时需要使用特定的输入格式(chatml),请按照ChatML格式组织输入。\" 之后介绍一下Chat ML格式<|im_end|>\n<|im_start|>assistant\n",
temperature: 0.75,
top_p: 0.8
}
}
);
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_3EP**********************************
This is your API token. Keep it to yourself.
import replicate
Run nomagick/qwen-14b-chat using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nomagick/qwen-14b-chat:f9e1ed25e2073f72ff9a3f46545d909b1078e674da543e791dec79218072ae70",
input={
"max_tokens": 2048,
"prompt": "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n<|im_start|>user\n请使用英文重复这段话:\"为了使模型生成最优输出,当使用 Qwen 时需要使用特定的输入格式(chatml),请按照ChatML格式组织输入。\" 之后介绍一下Chat ML格式<|im_end|>\n<|im_start|>assistant\n",
"temperature": 0.75,
"top_p": 0.8
}
)
# The nomagick/qwen-14b-chat 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/qwen-14b-chat/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=r8_3EP**********************************
This is your API token. Keep it to yourself.
Run nomagick/qwen-14b-chat 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/qwen-14b-chat:f9e1ed25e2073f72ff9a3f46545d909b1078e674da543e791dec79218072ae70",
"input": {
"max_tokens": 2048,
"prompt": "<|im_start|>system\\nYou are a helpful assistant<|im_end|>\\n<|im_start|>user\\n请使用英文重复这段话:\\"为了使模型生成最优输出,当使用 Qwen 时需要使用特定的输入格式(chatml),请按照ChatML格式组织输入。\\" 之后介绍一下Chat ML格式<|im_end|>\\n<|im_start|>assistant\\n",
"temperature": 0.75,
"top_p": 0.8
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
"To generate the optimal output from the model, a specific input format called ChatML is required when using Qwen. Please organize the input according to the ChatML format." ChatML (Chat Markup Language) is a specific format designed for organizing inputs for natural language processing models. It is a markup language that allows users to structure their input in a way that is easy for the model to understand. ChatML includes various tags and attributes that can be used to specify different aspects of the input, such as the type of input (e.g. text, image), the language of the input, and any special instructions or requirements for processing the input. By using ChatML, users can ensure that their input is properly formatted and structured, which can help to improve the accuracy and efficiency of the model's output.
{
"id": "4esfketbldzp6n455wencf2qja",
"model": "nomagick/qwen-14b-chat",
"version": "f9e1ed25e2073f72ff9a3f46545d909b1078e674da543e791dec79218072ae70",
"input": {
"max_tokens": 2048,
"prompt": "<|im_start|>system\nYou are a helpful assistant<|im_end|>\n<|im_start|>user\n请使用英文重复这段话:\"为了使模型生成最优输出,当使用 Qwen 时需要使用特定的输入格式(chatml),请按照ChatML格式组织输入。\" 之后介绍一下Chat ML格式<|im_end|>\n<|im_start|>assistant\n",
"temperature": 0.75,
"top_p": 0.8
},
"logs": "",
"output": [
"\"To",
" generate",
" the",
" optimal",
" output",
" from",
" the",
" model",
",",
" a",
" specific",
" input",
" format",
" called",
" Chat",
"ML",
" is",
" required",
" when",
" using",
" Q",
"wen",
".",
" Please",
" organize",
" the",
" input",
" according",
" to",
" the",
" Chat",
"ML",
" format",
".\"\n\n",
"Chat",
"ML",
" (",
"Chat",
" Markup",
" Language",
")",
" is",
" a",
" specific",
" format",
" designed",
" for",
" organizing",
" inputs",
" for",
" natural",
" language",
" processing",
" models",
".",
" It",
" is",
" a",
" markup",
" language",
" that",
" allows",
" users",
" to",
" structure",
" their",
" input",
" in",
" a",
" way",
" that",
" is",
" easy",
" for",
" the",
" model",
" to",
" understand",
".",
" Chat",
"ML",
" includes",
" various",
" tags",
" and",
" attributes",
" that",
" can",
" be",
" used",
" to",
" specify",
" different",
" aspects",
" of",
" the",
" input",
",",
" such",
" as",
" the",
" type",
" of",
" input",
" (",
"e",
".g",
".",
" text",
",",
" image",
"),",
" the",
" language",
" of",
" the",
" input",
",",
" and",
" any",
" special",
" instructions",
" or",
" requirements",
" for",
" processing",
" the",
" input",
".",
" By",
" using",
" Chat",
"ML",
",",
" users",
" can",
" ensure",
" that",
" their",
" input",
" is",
" properly",
" formatted",
" and",
" structured",
",",
" which",
" can",
" help",
" to",
" improve",
" the",
" accuracy",
" and",
" efficiency",
" of",
" the",
" model",
"'s",
" output",
"."
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-10-22T14:01:50.602991Z",
"started_at": "2023-10-22T14:08:58.113356Z",
"completed_at": "2023-10-22T14:09:22.556872Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/4esfketbldzp6n455wencf2qja/cancel",
"get": "https://api.replicate.com/v1/predictions/4esfketbldzp6n455wencf2qja"
},
"metrics": {
"predict_time": 24.443516,
"total_time": 451.953881
}
}