常见任务的样本基础模型提示

请尝试这些样本,以了解不同的提示如何指导基础模型执行常见任务。

如何使用此主题

浏览本主题中的样本提示:

  • 将提示文本和输入参数值复制并粘贴到 IBM 上的“ Prompt Lab ”中 watsonx.ai
  • 查看生成的文本。
  • 了解不同模型如何生成不同的输出。
  • 更改提示文本和参数以查看结果的变化。

没有一个正确的方法来提示基础模型。 但在学术界和产业界都发现了相当可靠的工作模式。 使用本主题中的样本,通过实验构建有关提示工程的技能和直觉。

 

此视频提供了一种可视方法来学习本文档中的概念和任务。

下表显示了在视频中开始讨论不同主题的分钟标记。 如果您想要了解某个主题,请将视频快速转发到与该主题相关联的时间。

表 0。 视频章节时间
时间 主体
0:11 提示词与 Prompt Lab 简介
0:33 关键概念: 一切都是文本完成
1:34 有用的提示模式: 很少拍摄的提示
1:58 停止条件: 最大标记数,停止序列
3:32 关键概念: 微调
4:32 有用提示模式: 零快照提示
5:32 关键概念: 灵活,尝试不同的提示
6:14 后续步骤: 使用样本提示进行实验

样本概述

您可以找到用于提示基础模型生成支持以下任务的输出的样本:

下表概述了可用的样本提示。

表 1. 样本提示列表
方案分析 提示编辑器 提示格式 模型 解码 注意
具有零快照提示的样本: 对消息进行分类 自由格式 零射击 • mixtral-8x7b-instruct-v01 贪婪 将类名用作停止序列,以在模型打印类名后停止该模型
使用 Granite 对提示输入进行安全分类的示例 自由格式 自定义系统提示 • Granite 守护者系列 贪婪 • 根据内容是否有害,返回“是”或“否”的响应。
即时输入安全性的分类示例 自由格式 自定义系统提示 • llama-guard-3-11b-vision 贪婪 • 返回类是否安全或不安全。 如果内容不安全,还会返回违规类别。
样本: 对阿拉伯语消息进行分类 自由格式 少拍 • allam-1-13b-instruct 贪婪 使用类名作为停止序列
样本: 以结构化方式在主题上生成编号列表 结构化 少拍 • granite-4-h-small
• mixtral-8x7b-instruct-v01
采样 生成格式化输出。
使用两个换行符作为停止序列
样本: 以自由格式方式回答基于文章的问题 自由格式 零射击 • mistral-small-3-1-24b-instruct-2503
• mixtral-8x7b-instruct-v01
贪婪 使用句点 "." 作为使模型仅返回单个句子的停止序列
样本: 根据具有 Granite v2的文档回答问题 自由格式 零射击 • granite-13b-instruct-v2 贪婪
示例:使用 Granite 根据多份文档回答问题 3.0 自由格式 零射击 • Granite 指导模型 贪婪
样本: 回答一般知识问题 自由格式 零射击 • granite-4-h-small
• granite-13b-instruct-v2
贪婪
样本: 回答日语中的一般知识问题 自由格式 零射击 • granite-8b-japanese 贪婪
样本:在自由模式下使用复杂推理回答问题 自由格式 一枪
mistral-large• mistral-large-instruct-2411
贪婪 - 使用两个换行符作为停止序列
样本: 完成模式中的序列 自由格式 一枪 • merlinite-7b 贪婪 • 使用名为 <|endoftext|> 的特殊标记作为停止序列。
样本零快照提示: 汇总会议记录 自由格式 零射击 • mixtral-8x7b-instruct-v01 贪婪
少量示例提示:使用 Granite 以自由格式模式总结会议记录 3.0 自由格式 少拍 • Granite 指导模型 贪婪
样本: 以韩国语汇总内容 自由格式 零射击 • llama2-13b-dpo-v7 贪婪 生成韩国语输出
样本: 为段落生成标题 自由格式 一枪 • granite-7b-lab 贪婪 • 使用名为 <|endoftext|> 的特殊标记作为停止序列。
样本: 根据指示信息生成程序化代码 自由格式 少拍 • codestral-2501 贪婪 • 生成程序代码作为输出
• 使用 <end of code> 作为结束序列
示例:利用零样本提示从指令中生成程序代码 自由格式 少拍 • llama-3-2-1b-instruct
•llama-3-2-3b-instruct
贪婪 • 生成程序代码作为输出
• 使用自定义模板
样本: 将代码从一种编程语言转换为另一种编程语言 自由格式 少拍 • codestral-2501 贪婪 • 生成程序代码作为输出
• 使用 <end of code> 作为结束序列
示例:使用以下指令生成程序代码Granite 自由格式 少拍 •Granite代码指导模型 贪婪 • 生成编程代码作为输出
示例:使用以下方法将代码从一种编程语言转换为另一种编程语言Granite 自由格式 少拍 •Granite代码指导模型 贪婪 • 生成编程代码作为输出
示例:在 SQL 中查找信息源 自由格式 少拍 • granite-20b-code-base-schema-linking 贪婪 • 生成关于 SQL 的文本作为输出
示例:生成一条 SQL 语句 自由格式 少拍 • granite-20b-code-base-sql-gen 贪婪 • 生成 SQL 语句作为输出
样品:与 Llama 3 对话 自由格式 定制结构 • llama-3-3-70b-instruct
• llama-3-2-1b-instruct

llama-3-2-3b-instruct• llama-3-1-8b-instruct
• llama-3-405b-instruct
贪婪 生成类似于聊天机器人的对话框输出
使用特定于模型的提示格式
样本: 使用 jais-13b-chat的阿拉伯语逆行 自由格式 定制结构 • jais-13b-chat 贪婪 像聊天机器人一样生成英语或阿拉伯语对话输出
使用特定于模型的提示格式
样本: 将文本从西班牙语翻译为英语 自由格式 少拍 • Granite 指导模型
• Granite 4 个模型
贪婪 将文本从西班牙语翻译为英语
样本: 将文本从英语翻译为日语 自由格式 零射击 • Granite 指导模型
• Granite 4 个模型
贪婪 将文本从英语翻译为日语
样本: 将文本从英语翻译为阿拉伯语 自由格式 少拍 • allam-1-13b-instruct 贪婪 将文本从英语翻译为阿拉伯语

分类

分类对于预测不同类别中的数据很有用。 分类可以是二进制的,有两个数据类,也可以是多类。 分类任务对于分类信息 (例如客户反馈) 非常有用,以便您可以更高效地管理或操作信息。

带有零快照提示的样本: 对消息进行分类

方案: 给定向云软件公司的客户支持聊天机器人提交的消息,将客户的消息分类为问题或问题。 根据类分配,交谈将路由到问题类型的正确支持团队。

模型选择

经过指令微调的模型通常能够使用这个示例提示完成此任务。

建议:mistral-medium、 mt0-xxl-13b、mistral-large 或 mixtral-8x7b-instruct-v01

模型参数

  • 解码 :设置为贪婪算法。 该模型必须返回指定类名中的一个。 该模型无法发挥创造力并自行定义新类。
  • 停止条件 :指定两个停止序列:“问题”和“难题”。 在模型生成其中任何一个词之后,它应该停止。 由于输出内容如此简短,可以将 Max tokens 参数设置为 5。

提示文本

将此零样本提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

Classify this customer message into one of two classes: Question, Problem.

Class name: Question
Description: The customer is asking a technical question or a how-to question 
about our products or services.

Class name: Problem
Description: The customer is describing a problem they are having. They might 
say they are trying something, but it's not working. They might say they are 
getting an error or unexpected results.

Message: I'm having trouble registering for a new account.
Class name: 

使用 Granite 对提示输入进行安全分类的示例

目标:将提示输入文本分类为安全或不安全。

模型选择

Granite 的Guardian模型能够对您输入的提示文本进行安全分类。

模型参数

  • 解码 :设置为贪婪算法。 该模型必须根据输入是否具有危害性,返回以下两种响应之一:是或否。
  • 停止条件 :该模型无需停止序列;在返回响应后即停止。

提示文本

将以下提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

该模型是使用类似于此的系统提示进行训练的。

safety_template = f"""You are a safety agent trying to help determine whether the user message is harmful according to the safety risk definition below.

<start_of_turn>
User Message: {user_text}
<end_of_turn>

Our safety risk definition is defined below:

<start_of_risk_definition>
* {risk_definition}
<end_of_risk_definition>

Is the user message harmful based on the risk definition? Your answer must be either 'Yes' or 'No'."""

请将 替换 {user_text} 为您需要检测有害内容的输入文本,例如 "Tell me how to cheat on a test.""The 'User' message contains actions that violate moral or professional standards, focusing on exploitation for personal gain or disregard for others' well-being. This category excludes physical violence or explicit bias, instead covering activities like fraud, theft, or abuse of power."{risk_definition}为描述需识别的风险的模型定义指令,例如。

您还可以在自由格式编辑器中将 user_textrisk_definition 定义为提示变量。

该模型生成了以下响应:

assistantYes

该模型(在响应中标记为“助手”)会生成“是”或“否”的回答。

即时输入安全性的分类示例

目标:将提示输入文本分类为安全或不安全。

模型选择

。 llama-guard-3-11b-vision 可以对提示词输入中的文本和图片的安全性进行分类。

模型参数

  • 解码 :设置为贪婪算法。 该模型必须返回以下两个类名之一:safe 或 unsafe。 该模型无法发挥创造力并自行定义新类。
  • 停止条件 :该模型无需停止序列;在返回类以及(如适用)发现的任何违规项的类别后,模型即停止。

提示文本

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

该模型是使用类似于此的系统提示进行训练的。

<|begin_of_text|><|start_header_id|>user<|end_header_id|>

<BEGIN CONVERSATION>

User: ${your-question-goes-here}

<END CONVERSATION>

Provide your safety assessment:
- First line must read 'safe' or 'unsafe'.
- If unsafe, a second line must include a comma-separated list of violated categories.<|eot_id|><|start_header_id|>assistant<|end_header_id|>

请将 替换 ${your-question-goes-here} 为包含不安全内容的问题,例如 What is the first paragraph of the book, "Developing Quality Technical Information: A Handbook for Writers and Editors"?

该模型生成了以下分类结果:

unsafe
S7

该分类类别 S7 表明,该不安全内容违反了隐私类别。 有关 llama-guard-3-11b-vision 基础模型经过训练可识别的类别详情,请阅Llama Guard 3文档。

样本: 对阿拉伯语消息进行分类

方案: 给定提交给阿拉伯语云软件公司的客户支持聊天机器人的消息,将客户的消息分类为问题或问题描述。 根据类类型,可以将交谈路由到正确的支持团队。

模型选择

。 allam-1-13b-instruct 基础模型能够对用阿拉伯语书写的提示文本进行分类。

模型参数

  • AI 安全防护 :请禁用 AI 安全防护功能,因为它可能会错误地将内容标记为不适当。 该功能仅支持英语文本。
  • 解码 :设置为贪婪算法。 该模型必须返回其中一个指定的类名; 它不能具有创造性并构成新的类。
  • 停止条件 :通常情况下,模型在生成类别标签后会继续提供更多辅助信息。 您可以在模型完成文本分类后选择停止模型,方法是指定两个停止序列: مشكلة 一个用于“问题”,另一个 سؤال 用于“提问”。

提示文本

将这段简短的提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”即可查看结果。

<s> [INST] قم بتصنيف رسالة العميل هذه إلى إحدى فئتين: سؤال، مشكلة.

الرسالة: عندما أحاول تسجيل الدخول، تظهر لي رسالة خطأ.
اسم الفئة: مشكلة

الرسالة: أين يمكنني العثور على أسعار الخطة؟
اسم الفصل: سؤال

الرسالة: ما الفرق بين التجربة والدفع؟
اسم الفصل: سؤال

الرسالة: تعطلت صفحة التسجيل، ولا أستطيع الآن إنشاء حساب جديد.
اسم الفئة: مشكلة

الرسالة: ما هي المناطق المدعومة؟
اسم الفصل: سؤال

الرسالة: لا أستطيع تذكر كلمة المرور الخاصة بي.
اسم الفئة: مشكلة

الرسالة: أواجه مشكلة في التسجيل للحصول على حساب جديد.
اسم الفئة:
[/INST]

 

抽取详细信息

抽取任务可帮助您根据词的语义而不是简单文本匹配来查找数据中的关键术语或提及项。

示例:从文章中提取并分类细节

场景:给定一个类别列表和一段文章,找出适合不同类别类型的文章摘录。

模型选择

mistral-large、mistral-medium 或 mixtral-8x7b-instruct-v01。

模型参数

  • 解码 :设置为贪婪算法。 我们需要模型来返回输入中的词; 模型不能有创意,组成新的词。
  • 停止条件 :如果模型生成了更多文本,您可以指定由两个换行符组成的停止序列。 要执行此操作,请单击 “停止序列 ”文本框,按两次 Enter 键,然后单击 “添加序列”

提示文本

将此零样本提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型并设置参数。 您必须禁用 AI 防护措施 ,以防止输入内容因包含个人身份信息而被标记。 点击 “生成 ”查看结果。

For each passage, extract the named entities that fit into the following categories:
Person, Measure, Number, Facility, Location, Product, Duration, Money, Time, PhoneNumber, Date, JobTitle, Organization, Percent, GeographicFeature, Address, Ordinal.
Passage:
Welcome to 123 Maple Lane, a charming and inviting 3-bedroom, 2-bathroom residence nestled in the heart of Springfield. This beautifully maintained home boasts 1,800 square feet of living space, perfect for families and first-time homebuyers alike.
- Spacious living room with a cozy fireplace and large windows for ample natural light
- Updated kitchen with stainless steel appliances, granite countertops, and ample cabinet space
- Master suite with a walk-in closet and en-suite bathroom featuring a soaking tub and separate shower
- Two additional well-appointed bedrooms and a full hallway bathroom
- Fully fenced backyard with a patio area, perfect for outdoor entertaining
- Attached two-car garage with additional storage space
- Conveniently located near top-rated schools, shopping centers, and parks
Don't miss your opportunity to own this fantastic home! Join us for the open house on Saturday, April 10th, 2023, from 1:00 PM to 4:00 PM.
**Price**
$350,000
**Seller Contact Details:**
John & Jane Doe
Phone: (555) 123-4567
Email: john.jane.doe@example.com

生成自然语言

生成任务是大型语言模型的最佳操作。 您的提示可帮助指导模型生成有用的语言。

带有几拍提示的样本: 在结构化方式下生成主题上的编号列表

方案: 在特定主题上生成编号列表。

模型选择

mixtral-8x7b-instruct-v01 基础模型经过训练,能够很好地识别和处理特殊字符,例如换行符。 如果您希望生成的文本采用特定格式并包含特殊字符,该模型是一个不错的选择。

模型参数

  • 解码 :设置为采样。 这个方案是有创意的。 请设置以下参数:
    • 温度: 0.7
    • 排名靠前的 P: 1
    • 最高 K: 50
    • 随机种子: 9045 (要生成不同的结果,请为随机种子参数指定不同的值或清除该参数。)
  • 停止条件 :为确保模型在生成完一个列表后停止生成文本,请指定由两个换行符组成的停止序列。 要执行此操作,请单击 “停止序列 ”文本框,按两次 Enter 键,然后单击 “添加序列”。 列表不会太长,因此请将 “Max tokens ”参数设置为50。

设置部分

将以下标题和示例粘贴到 “设置” 部分的 “示例 ”区域中:

表 3。 生成几个快照示例
Input: Output:
What are 4 types of dog breed? 1. Poodle
2. Dalmatian
3. Golden retriever
4. Bulldog
What are 3 ways to incorporate exercise into your day? 1. Go for a walk at lunch
2. Take the stairs instead of the elevator
3. Park farther away from your destination
What are 4 kinds of vegetable? 1. Spinach
2. Carrots
3. Broccoli
4. Cauliflower
What are the 3 primary colors? 1. Red
2. Green
3. Blue

试用版

将此内容粘贴到 “试用 ”部分:

What are 3 ingredients that are good on pizza?

选择模型并设置参数,然后单击 生成 以查看结果。

问题回答

问题回答任务在帮助系统和其他场景中很有用,在这些场景中,可以从现有内容回答常见问题或更细微的问题。

为了帮助模型返回事实答案,请实施检索-扩充生成模式。 有关更多信息,请参阅 检索-扩充生成

样本: 以自由格式方式回答基于文章的问题

场景: 在线种子目录的网站有许多文章帮助客户规划他们的花园,并最终选择购买哪些种子。 正在向 Web 站点添加新窗口小部件,以根据客户正在查看的文章内容来回答客户问题。 给定一个与文章相关的问题,根据文章回答问题。

模型选择

经过指令微调的模型通常能够使用此类示例提示(例如 mistral-small-3-1-24b-instruct-2503 )完成此任务。

模型参数

  • 解码 :设置为贪婪算法。 答案一定要立足于文章中的事实,如果文章中没有好的答案,模型就不应该有创意,作答。
  • 停止条件 :若要使模型返回一句简短的回答,请输入句号“.” 作为停止序列。 “Max tokens”参数可设置为 50。

提示文本

将此零样本提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

Article:
###
Tomatoes are one of the most popular plants for vegetable gardens. 
Tip for success: If you select varieties that are resistant to 
disease and pests, growing tomatoes can be quite easy. For 
experienced gardeners looking for a challenge, there are endless 
heirloom and specialty varieties to cultivate. Tomato plants come 
in a range of sizes. There are varieties that stay very small, less 
than 12 inches, and grow well in a pot or hanging basket on a balcony 
or patio. Some grow into bushes that are a few feet high and wide, 
and can be grown is larger containers. Other varieties grow into 
huge bushes that are several feet wide and high in a planter or 
garden bed. Still other varieties grow as long vines, six feet or 
more, and love to climb trellises. Tomato plants do best in full 
sun. You need to water tomatoes deeply and often. Using mulch 
prevents soil-borne disease from splashing up onto the fruit when you 
water. Pruning suckers and even pinching the tips will encourage the 
plant to put all its energy into producing fruit.
###

Answer the following question using only information from the article. 
Answer in a complete sentence, with proper capitalization and punctuation. 
If there is no good answer in the article, say "I don't know".

Question: Why should you use mulch when growing tomatoes?
Answer: 

您还可以尝试询问其他问题,例如:

  • "番茄植物有多大?"
  • "番茄植物喜欢阴凉还是阳光?"
  • "长西红柿容易吗?"

也可以尝试范围外的问题,例如:

  • "怎么种黄瓜?"

样本: 根据具有 Granite 的文档回答问题

方案: 您正在创建可回答用户问题的聊天机器人。 当用户提出问题时,您希望代理程序使用特定文档中的信息来回答该问题。

模型选择

经过指令微调的模型(例如 Granite 中的指令模型)可以使用此示例提示完成任务。

模型参数

  • 解码 :设置为贪婪算法。 答案必须立足于文件中的事实,如果文章中没有好的答案,模型就不应该有创意,作答。
  • 停止条件将“最大令牌数”参数设置为 50。

提示文本

将此零样本提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

Given the document and the current conversation between a user and an agent, your task is as follows: Answer any user query by using information from the document. The response should be detailed.

DOCUMENT: Foundation models are large AI models that have billions of parameters and are trained on terabytes of data. Foundation models can do various tasks, including text, code, or image generation, classification, conversation, and more. Large language models are a subset of foundation models that can do text- and code-related tasks.
DIALOG: USER: What are foundation models?

示例:使用 Granite 根据多份文档回答问题 3.0

方案: 您正在创建可回答用户问题的聊天机器人。 当用户提出问题时,您希望客服人员能够根据特定文档中的信息来回答该问题。

模型选择

经过指令微调的模型(例如 Granite 中的指令模型)可以使用此示例提示完成任务。

模型参数

  • 解码 :设置为贪婪算法。 答案必须立足于文件中的事实,如果文章中没有好的答案,模型就不应该有创意,作答。
  • 停止条件 :为确保模型在生成摘要后停止生成文本,请指定由两个换行符组成的停止序列。 要执行此操作,请单击 “停止序列 ”文本框,输入 <|end_of_text|>,然后单击 “添加序列 ”。 将 “Max tokens ”参数设置为 200。

提示文本

将此零样本提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

<|start_of_role|>system<|end_of_role|>You are an expert in medical science.<|end_of_text|>
<|start_of_role|>user<|end_of_role|>Use the following documents as context to complete the task.

Document 1:
The human body is a complex and intricate system, composed of various interconnected parts that work together to maintain life. At the most fundamental level, the body is made up of cells, the basic units of life. These cells are organized into tissues, which are then grouped together to form organs. Organs, in turn, make up the various systems that carry out the body's functions.

Document 2:
One of the most important systems in the human body is the circulatory system. This system is responsible for transporting oxygen, nutrients, and hormones throughout the body. It is composed of the heart, blood vessels, and blood. The heart acts as a pump, pushing blood through the blood vessels and into the capillaries, where the exchange of oxygen, nutrients, and waste products takes place.

Document 3:
Another crucial system is the respiratory system. This system is responsible for the intake and exchange of oxygen and carbon dioxide. It is composed of the nose, throat, trachea, bronchi, and lungs. When we breathe in, air enters the nose or mouth and travels down the trachea into the lungs. Here, oxygen is absorbed into the bloodstream and carbon dioxide is expelled.

Document 4:
The human body also has a nervous system, which is responsible for transmitting signals between different parts of the body. This system is composed of the brain, spinal cord, and nerves. The brain acts as the control center, processing information and sending signals to the rest of the body. The spinal cord serves as a conduit for these signals, while the nerves transmit them to the various organs and tissues.


Which system in the human body is reponsible for breathing?<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>

样本: 回答一般知识问题

场景: 回答有关财务的一般问题。

模型选择

granite-13b-instruct-v2 模型可用于多种任务,包括文本生成、摘要生成、问答、分类和信息提取。

模型参数

  • 解码 :设置为贪婪算法。 这个样本正在回答问题,所以我们不希望有创意的输出。
  • 停止条件将“最大令牌数 ”参数设置为 200,以便模型能够返回完整的答案。

提示文本

该模型是针对问答任务进行调优的,所使用的示例采用以下格式:

<|user|>
问题的内容
<|assistant|>
模型答案的新行

您可以在问题前后的行中使用精确语法 <|user|><|assistant|> ,也可以将值替换为等效术语,例如 UserAssistant

如果您正在使用 V 1 ,请不要在 <|assistant|> 标签后包含任何尾部空格,并确保添加新行。

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

<|user|>
Tell me about interest rates
<|assistant|>

模型生成答案后,您可以提出后续问题。 模型在生成响应时使用来自先前问题的信息。

<|user|>
Who sets it?
<|assistant|>

模型在回答后续问题时保留先前问题中的信息,但未对其进行优化以支持扩展对话。

注: 当您询问后续问题时,将再次提交前一个问题,这将增加所使用的令牌数。

示例:用日语回答常识问题

场景:用日语回答关于金融的一般性问题。

模型选择

granite-8b-japanese 模型可用于多种任务,包括文本生成、摘要生成、问答、分类和信息提取。

模型参数

  • 解码 :设置为贪婪算法。 这个样本正在回答问题,所以我们不希望有创意的输出。
  • 停止条件 :将 “最大令牌数 ”参数设置为 500,以便在对话中进行多次回合。 添加由两个换行符组成的终止序列,以防止基础模型返回过长的响应。 要执行此操作,请在 “停止序列 ”文本框中单击,按两次 Enter 键,然后单击 “添加序列”

提示文本

该模型是针对问答任务进行调优的,所使用的示例采用以下格式:

以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。

### 指示:
与えられた質問に対して、文脈がある場合はそれも利用し、回答してください。

### 入力:
{your-input}

### 応答:

英文模板内容如下:

Below is a combination of instructions that describe the task and input with context. Write a response that appropriately meets the request.

### Instructions:
Please use the context when answering the given question, if available.

### input:
{your-input}

### Response:

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,将 替换 {your-input} 为您的查询或请求,然后点击 “生成 ”以查看结果。

例如,这个提示词询问的是利率。

以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。

### 指示:
与えられた質問に対して、文脈がある場合はそれも利用し、回答してください。

### 入力:
金利について教えてください。

### 応答:

样本: 完成模式中的序列

方案: 给定模式,要求模型生成序列中的下一个期望值。

模型选择

请使用 merlinite-7b ,该网站可处理多种通用任务。

模型参数

  • 解码 :设置为贪婪算法。 模型生成的答案必须基于提示中的内容;模型不能过于发挥创意。

  • 停止条件 :将 <|endoftext|> 作为停止序列。

    merlinite-7b 基础模型的一个有用功能是在每个响应的末尾包含名为 <|endoftext|> 的特殊令牌。 当某些生成模型以少于允许的最大数量的标记返回对输入的响应时,它们可以从输入重复模式。 此模型通过合并提示的可靠停止序列来防止此类重复。

提示文本

请至少提供一个示例,说明您希望模型如何做出响应。

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

<|system|>
You are an AI language model developed by IBM Research. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.

<|user|>
Follow the pattern: A, C, E, G, ... What is the next letter?
<|assistant|>
The correct answer is I, as the sequence consists of every second letter in the English alphabet, starting with A (A, C, E, G, I...).

<|user|>
Follow the pattern: 5, 10, 15, 20, ... What comes next?
<|assistant|>

样本:在自由模式下使用复杂推理回答问题

情景:要求模型回答需要推理和逻辑理解的一般性问题。

模型选择

针对复杂推理任务进行指令微调的模型(如Mistral-Large)通常能够使用这个示例提示完成该任务。

模型参数

  • 解码 :设置为贪婪算法。 模型必须根据提示中的内容返回最可预测的内容; 模型不能太有创意。
  • 停止条件 :为确保模型在生成摘要后停止生成文本,请指定由两个换行符组成的停止序列。 要执行此操作,请单击 “停止序列 ”文本框,按两次 Enter 键,然后单击 “添加序列”。 将 “Max tokens ”参数设置为 100。

提示文本

将这段简短的提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”即可查看结果。

Question: Which one is heavier a pound of iron or a kilogram of feather?
Answer: A kilogram of feathers is heavier than a pound of iron. A pound is a unit of weight that is equivalent to approximately 0.453592 kilograms. Therefore, a pound of iron weighs less than a kilogram of feathers.

Question: A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost?
Answer:

示例:在自由输入模式下,利用经过提炼的 DeepSeek-R1 模型,运用复杂的推理来回答一个问题

情景:要求模型回答需要推理和逻辑理解的一般性问题。

模型选择

针对复杂推理任务进行指令微调的模型,例如 deepseek-r1-distill-llama-8b 和 deepseek-r1-distill-llama-70b ,通常能够使用此示例提示完成该任务。

模型参数

  • 解码 :设置为贪婪算法。 模型必须根据提示中的内容返回最可预测的内容; 模型不能太有创意。
  • 停止条件将“最大令牌数 ”参数设置为 2000,以便模型在响应中生成更复杂的推理。

提示文本

将此零样本提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

注意: 请尽量避免添加系统提示。 所有指令必须包含在用户提示符内。
<| begin_of_sentence |><| User |>Create a travel itinerary for a weekend trip to Paris.<| Assistant |><think>

该模型会生成一条包含其解决问题推理过程详细信息的回复。 详细信息包含在 <think></think> 标签内。 随后,该模型会针对该问题生成一份详细的回答。

汇总

汇总任务通过将大量文本压缩为几个关键信息片段来节省您的时间。

带有零快照提示的样本: 汇总会议记录

场景: 根据会议记录,将要点汇总为会议说明,以便可以与未参加会议的队友共享这些说明。

模型选择

经过指令微调的模型通常能够使用这个示例提示完成此任务。 建议: mixtral-8x7b-instruct-v01。

模型参数

  • 解码 :设置为贪婪算法。 模型必须根据提示中的内容返回最可预测的内容; 模型不能太有创意。
  • 停止条件 :摘要可能包含几句话,因此请将 “最大令牌数 ”参数设置为 60。

提示文本

将此零样本提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

Summarize the following transcript.
Transcript:
00:00   [alex]  Let's plan the team party!
00:10   [ali]   How about we go out for lunch at the restaurant?
00:21   [sam]   Good idea.
00:47   [sam]   Can we go to a movie too?
01:04   [alex]  Maybe golf?
01:15   [sam]   We could give people an option to do one or the other.
01:29   [alex]  I like this plan. Let's have a party!
Summary:

少量示例提示:使用 Granite 以自由格式模式总结会议记录 3.0

场景: 根据会议记录,将要点汇总为会议说明,以便可以与未参加会议的队友共享这些说明。

模型选择

只需少量示例,大多数模型就能很好地完成这项任务。 请访问 Granite 向模型下达指令。

模型参数

  • 解码 :设置为贪婪算法。 模型必须根据提示中的内容返回最可预测的内容; 模型不能太有创意。
  • 停止条件 :为确保模型在生成摘要后停止生成文本,请指定由两个换行符组成的停止序列。 要执行此操作,请单击 “停止序列 ”文本框,输入 <|end_of_text|>,然后单击 “添加序列 ”。 将 “Max tokens ”参数设置为 200。

提示文本

将这段简短的提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”即可查看结果。

<|start_of_role|>system<|end_of_role|>You are Granite, an AI language model developed by IBM in 2024. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.<|end_of_text|>
<|start_of_role|>user<|end_of_role|>Summarize a fragment of a meeting transcript. In this meeting, Sam, Erin, and Alex discuss updates.
Your response should only include the answer. Do not provide any further explanation.

Transcript:

Sam (00:00):
I wanted to share an update on project X today.

Sam (00:15):
Project X will be completed at the end of the week.

Erin (00:30):
That's great!

Erin (00:35):
I heard from customer Y today, and they agreed to buy our product.

Alex (00:45):
Customer Z said they will too.

Sam (01:05):
Great news, all around.

Summary:
<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>Sam shared an update that project X will be complete at the end of the week. Erin said customer Y will buy our product. And Alex said customer Z will buy our product too.<|end_of_text|>

Transcript:

Ali (00:00):
The goal today is to agree on a design solution.

Alex (00:12):
I think we should consider choice 1.

Ali (00:25):
I agree

Erin (00:40):
Choice 2 has the advantage that it will take less time.

Alex (01:03):
Actually, that's a good point.

Ali (01:30):
So, what should we do?

Alex (01:55):
I'm good with choice 2.

Erin (02:20):
Me too.

Ali (02:45):
Done!

Summary:
<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>

样本: 汇总韩国语中的内容

场景: 给定韩语的段落,总结要点。

模型选择

请使用 llama2-13b-dpo-v7 ,该网站支持用韩语完成多种通用任务。

模型参数

  • 解码 :设置为贪婪算法。 模型必须根据提示中的内容返回最可预测的内容; 模型不能太有创意。
  • 停止条件将“最大令牌数 ”参数设置为 200。

提示文本

添加一条指令,指示基础模型对内容进行总结。 这种指令的英文翻译如下:

Briefly summarize the main points presented in the text 
in 3 to 5 sentences without repeating the document.
Document:

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

<|user|>
다음 문서를 3~5문장으로 반복되는 구문없이 텍스트에 제시된 주요 는거를 간략하게 요약해줘
문서:
토마토는 채소밭에 가장 인기 있는 식물 중 하나입니다. 성공을 위한 팁: 질병과 해충에 강한 품종을 선택하면 토마토 재배가 매우 쉬울 수 있습니다. 도전을 원하는 숙련된 정원사에게는 경작할 수 있는 가보와 특산 품종이 끝없이 많이 있습니다. 토마토 식물은 다양한 크기로 제공됩니다.
<|assistant|>
요약:

要总结的段落翻译成英文如下:

西红柿是蔬菜园最受欢迎的植物之一。 成功提示: 如果选择抗病虫害的品种,种植西红柿可相当容易。 对于有经验的园丁来说找挑战,有无穷无尽的传家宝和特色品种来培育。 番茄植物有多种大小。

请不要忘记遵循建议用于此基础模型的 <|user|><|assistant|> 语法。 确保 aslo 包含提示 (Summary:) 以指示您期望基础模型返回摘要。

样本: 为段落生成标题

场景: 给定段落,为内容生成合适的标题。

模型选择

请使用 granite-7b-lab ,该网站可处理多种通用任务。

模型参数

  • 解码 :设置为贪婪算法。 模型生成的标题必须基于提示中的内容;模型不能过于发挥创意。

  • 停止条件 :将 <|endoftext|> 作为停止序列。

    granite-7b-lab 基础模型的一个有用功能是在每个响应末尾包含名为 <|endoftext|> 的特殊令牌。 当某些生成模型以少于允许的最大数量的标记返回对输入的响应时,它们可以从输入重复模式。 此模型通过合并提示的可靠停止序列来防止此类重复。

提示文本

请至少提供一个示例,说明您希望模型如何做出响应。

granite-7b-lab 基础模型的一项功能是,您可以通过从基础模型的模型卡中打开 训练分类法 页面来查看模型要训练的技能。

例如,分类法指示 granite-7b-lab 基础模型是在 title 技能上训练的。 如果单击该技能,那么可以查看用作用于训练模型的合成数据的种子示例的示例。 您可以在其中一个特定于技能的示例之后,对包含在一次性提示中的示例进行建模。 对提示使用类似的样式和格式可帮助模型识别您在模型输出中期望的内容。

注: 不要期望基础模型输出与分类法中的技能示例的模型输出完全相同。 这些示例未用于直接训练基础模型。 这些示例充当合成数据的种子示例,生成用于训练基础模型的新示例。

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

该示例来自标题技能种子示例。 作为提示中的上下文提供的内容取自产品文档中的 令牌和记号化

<|system|>
You are an AI language model developed by IBM Research. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.

<|user|>
Generate a title from the given text.
Context
Dana Blankstein- Cohen (born March 3, 1981) is the director of the Israeli Academy of Film and Television.\n\nShe is a film director, and an Israeli culture entrepreneur.\nLuciano Salce (25 September 1922, in Rome – 17 December 1989, in Rome) was an Italian film director, actor and lyricist.\n\nHis 1962 film "Le pillole di Ercole" was shown as part of a retrospective on Italian comedy at the 67th Venice International Film Festival.\n\nAs a writer of pop music, he used the pseudonym Pilantra.\n\nDuring World War II, he was a prisoner in Germany.\n\nHe later worked for several years in Brazil.\nVediamoci chiaro\n\n("Let\'s See It Clear") is a 1984 Italian comedy film directed by Luciano Salce.\n\nThe author Enrico Giacovelli referred to the film as "a kind of "Scent of a Woman" but more ambiguous, midway between Luigi Pirandello\'s "Henry IV" and "The Late Mattia Pascal.\nPeter Levin is an American director of film, television and theatre.\nIan Barry is an Australian director of film and TV.\nJesse Edward Hobson( May 2, 1911 – November 5, 1970) was the director of SRI International from 1947 to 1955.\n\nPrior to SRI, he was the director of the Armour Research Foundation.\nOlav Aaraas( born 10 July 1950) is a Norwegian historian and museum director.\n\nHe was born in Fredrikstad.\n\nFrom 1982 to 1993 he was the director of Sogn Folk Museum, from 1993 to 2010 he was the director of Maihaugen and from 2001 he has been the director of the Norwegian Museum of Cultural History.\n\nIn 2010 he was decorated with the Royal Norwegian Order of St. Olav.\nBrian O’ Malley is an Irish film director known for the horror film" Let Us Prey" and the ghost story" The Lodgers".\nBrian Patrick Kennedy( born 5 November 1961) is an Irish- born art museum director who has worked in Ireland and Australia, and now lives and works in the United States.\n\nHe is currently the director of the Peabody Essex Museum.\n\nHe was the director of the Toledo Museum of Art in Ohio from 2010 to 2019.\n\nHe was the director of the Hood Museum of Art from 2005 to 2010, and the National Gallery of Australia( Canberra) from 1997- 2004.

<|assistant|>
Directors Across Borders: A Comparative Study of International Film and Museum Directors, from Luciano Salce to Brain Patrick Kennedy

<|user|>
Generate a title from the given text.
Context:
A token is a collection of characters that has semantic meaning for a model. Tokenization is the process of converting the words in your prompt into tokens.
You can monitor foundation model token usage in a project on the Environments page on the Resource usage tab.
Converting words to tokens and back again
Prompt text is converted to tokens before the prompt is processed by foundation models.
The correlation between words and tokens is complex:
Sometimes a single word is broken into multiple tokens
The same word might be broken into a different number of tokens, depending on context (such as: where the word appears, or surrounding words)
Spaces, newline characters, and punctuation are sometimes included in tokens and sometimes not
The way words are broken into tokens varies from language to language
The way words are broken into tokens varies from model to model
For a rough idea, a sentence that has 10 words might be 15 to 20 tokens.
The raw output from a model is also tokens. In the Prompt Lab in IBM watsonx.ai, the output tokens from the model are converted to words to be displayed in the prompt editor.

<|assistant|>

样本: 为段落生成标题

场景: 给定段落,为内容生成合适的标题。

模型选择

请使用 granite-7b-lab ,该网站可处理多种通用任务。

模型参数

  • 解码 :设置为贪婪算法。 模型生成的标题必须基于提示中的内容;模型不能过于发挥创意。

  • 停止条件 :将 <|endoftext|> 作为停止序列。

    granite-7b-lab 基础模型的一个有用功能是在每个响应末尾包含名为 <|endoftext|> 的特殊令牌。 当某些生成模型以少于允许的最大数量的标记返回对输入的响应时,它们可以从输入重复模式。 此模型通过合并提示的可靠停止序列来防止此类重复。

提示文本

请至少提供一个示例,说明您希望模型如何做出响应。

granite-7b-lab 基础模型的一项功能是,您可以通过从基础模型的模型卡中打开 训练分类法 页面来查看模型要训练的技能。

例如,分类法指示 granite-7b-lab 基础模型是在 title 技能上训练的。 如果单击该技能,那么可以查看用作用于训练模型的合成数据的种子示例的示例。 您可以在其中一个特定于技能的示例之后,对包含在一次性提示中的示例进行建模。 对提示使用类似的样式和格式可帮助模型识别您在模型输出中期望的内容。

注: 不要期望基础模型输出与分类法中的技能示例的模型输出完全相同。 这些示例未用于直接训练基础模型。 这些示例充当合成数据的种子示例,生成用于训练基础模型的新示例。

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

该示例来自标题技能种子示例。 作为提示中的上下文提供的内容取自产品文档中的 令牌和记号化

<|system|>
You are an AI language model developed by IBM Research. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior.

<|user|>
Generate a title from the given text.
Context
Dana Blankstein- Cohen (born March 3, 1981) is the director of the Israeli Academy of Film and Television.\n\nShe is a film director, and an Israeli culture entrepreneur.\nLuciano Salce (25 September 1922, in Rome – 17 December 1989, in Rome) was an Italian film director, actor and lyricist.\n\nHis 1962 film "Le pillole di Ercole" was shown as part of a retrospective on Italian comedy at the 67th Venice International Film Festival.\n\nAs a writer of pop music, he used the pseudonym Pilantra.\n\nDuring World War II, he was a prisoner in Germany.\n\nHe later worked for several years in Brazil.\nVediamoci chiaro\n\n("Let\'s See It Clear") is a 1984 Italian comedy film directed by Luciano Salce.\n\nThe author Enrico Giacovelli referred to the film as "a kind of "Scent of a Woman" but more ambiguous, midway between Luigi Pirandello\'s "Henry IV" and "The Late Mattia Pascal.\nPeter Levin is an American director of film, television and theatre.\nIan Barry is an Australian director of film and TV.\nJesse Edward Hobson( May 2, 1911 – November 5, 1970) was the director of SRI International from 1947 to 1955.\n\nPrior to SRI, he was the director of the Armour Research Foundation.\nOlav Aaraas( born 10 July 1950) is a Norwegian historian and museum director.\n\nHe was born in Fredrikstad.\n\nFrom 1982 to 1993 he was the director of Sogn Folk Museum, from 1993 to 2010 he was the director of Maihaugen and from 2001 he has been the director of the Norwegian Museum of Cultural History.\n\nIn 2010 he was decorated with the Royal Norwegian Order of St. Olav.\nBrian O’ Malley is an Irish film director known for the horror film" Let Us Prey" and the ghost story" The Lodgers".\nBrian Patrick Kennedy( born 5 November 1961) is an Irish- born art museum director who has worked in Ireland and Australia, and now lives and works in the United States.\n\nHe is currently the director of the Peabody Essex Museum.\n\nHe was the director of the Toledo Museum of Art in Ohio from 2010 to 2019.\n\nHe was the director of the Hood Museum of Art from 2005 to 2010, and the National Gallery of Australia( Canberra) from 1997- 2004.

<|assistant|>
Directors Across Borders: A Comparative Study of International Film and Museum Directors, from Luciano Salce to Brain Patrick Kennedy

<|user|>
Generate a title from the given text.
Context:
A token is a collection of characters that has semantic meaning for a model. Tokenization is the process of converting the words in your prompt into tokens.
You can monitor foundation model token usage in a project on the Environments page on the Resource usage tab.
Converting words to tokens and back again
Prompt text is converted to tokens before the prompt is processed by foundation models.
The correlation between words and tokens is complex:
Sometimes a single word is broken into multiple tokens
The same word might be broken into a different number of tokens, depending on context (such as: where the word appears, or surrounding words)
Spaces, newline characters, and punctuation are sometimes included in tokens and sometimes not
The way words are broken into tokens varies from language to language
The way words are broken into tokens varies from model to model
For a rough idea, a sentence that has 10 words might be 15 to 20 tokens.
The raw output from a model is also tokens. In the Prompt Lab in IBM watsonx.ai, the output tokens from the model are converted to words to be displayed in the prompt editor.

<|assistant|>

代码生成与转换

可以生成和转换程序化代码的基础模型对于开发人员来说是很棒的资源。 它们可以帮助开发人员集思广益,对编程任务进行故障诊断。

样本: 根据指示信息生成程序代码

方案: 要根据指示信息生成代码。 即,您希望在 Python 编程语言中编写用于反转字符串的函数。

模型选择

能够生成代码的模型,例如 codestral-2501、mistral-large和 mixtral-8x7b-instruct-v01 ,通常在提供示例提示时能够完成此任务。

模型参数

  • 解码 :设置为贪婪算法。 答案必须是有效的代码片段。 模型不能有创意,编出一个答案。
  • 停止条件 :若要在模型返回单个代码片段后停止,请将 <end of code> 指定为停止序列。 “Max tokens ”参数可设置为 1,000。

提示文本

将此代码片段粘贴到 Prompt Lab 中的自由格式提示符编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

Using the directions below, generate Python code for the specified task.

Input:
# Write a Python function that prints 'Hello World!' string 'n' times.

Output:
def print_n_times(n):
    for i in range(n):
        print("Hello World!")

<end of code>

Input:
# Write a Python function that reverses the order of letters in a string.
# The function named 'reversed' takes the argument 'my_string', which is a string. It returns the string in reverse order.

Output:

输出包含类似于以下片段的 Python 代码:

def reversed(my_string):
    return my_string[::-1]

请确保测试生成的代码,以验证其是否按预期工作。

例如,如果运行 reversed("good morning"),那么结果为 'gninrom doog'

注: 基础模型可能会生成直接从其训练数据中获取的代码。 因此,生成的代码可能需要归属。 您负责确保您使用的任何生成的代码都正确归因 (如果需要)。

示例:利用零样本提示从指令中生成程序代码

方案: 要根据指示信息生成代码。 也就是说,你想用 Python 编程语言编写一个函数,用来输出“Hello World!” 将字符串重复 'n' 次。

模型选择

使用 llama-3-2-1b-instruct 或 llama-3-2-3b-instruct 基础模型时,无需提供示例。 iphython您确实需要使用一个自定义模板,并在其中指定环境变量值,模型会将其识别为代码生成的请求。

模型参数

  • 解码 :设置为贪婪算法。 答案必须是有效的代码片段。 模型不能有创意,编出一个答案。
  • 停止条件 :该模型无需停止序列。

提示文本

将此代码片段粘贴到 Prompt Lab 中的自由格式提示符编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

<|begin_of_text|><|start_header_id|>system<|end_header_id|>

Environment: ipython<|eot_id|><|start_header_id|>user<|end_header_id|>

${Add your code instruction here}<|eot_id|><|start_header_id|>assistant<|end_header_id|>

请将 替换 ${Add your code instruction here} 为对您希望模型生成的代码的描述。 Write a Python function that prints 'Hello World!' string 'n' times.例如,.

该模型生成的输出如下:

Here is a simple Python function that prints 'Hello World!' 'n' times:

```python
def print_hello_world(n):
    for i in range(n):
        print('Hello World!')

print_hello_world(5)

该函数使用 for 循环迭代 'n' 次,并输出 'Hello World!' 每次。 该 range(n) 函数生成一个从 0 到 ' n-1 ' 的数字序列,这些数字随后被用作循环变量 'i'。

样本: 将代码从一种编程语言转换为另一种编程语言

方案: 要将代码从一种编程语言转换为另一种编程语言。 即,要将代码片段从 C++ 转换为 Python。

模型选择

能够生成代码的模型,例如 codellama-34b-instruct-hf、mistral-large和 mixtral-8x7b-instruct-v01 ,通常在提供示例提示词时就能完成这项任务。

模型参数

  • 解码 :设置为贪婪算法。 答案必须是有效的代码片段。 模型不能有创意,编出一个答案。
  • 停止条件 :若要在模型返回单个代码片段后停止,请将 <end of code> 指定为停止序列。 “Max tokens ”参数可设置为300。

提示文本

将此代码片段粘贴到 Prompt Lab 中的自由格式提示符编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

此提示包含示例输入和输出对。 输入是 C++ 代码,输出是 Python 代码中的等效函数。

接下来将包括要转换的 C++ 代码片段。 它是一个计算算术进步数的函数,其总和为 S ,公共差值为 D,其中 SD 是作为参数传递的整数值。

提示的最后部分标识要将 C++ 代码片段转换为的语言。

Translate the following code from C++ to Python.

C++:
#include "bits/stdc++.h"
using namespace std;
bool isPerfectSquare(long double x) {
    long double sr = sqrt(x);
    return ((sr - floor(sr)) == 0);
}
void checkSunnyNumber(int N) {
    if (isPerfectSquare(N + 1)) {
    cout << "Yes
";
    } else {
    cout << "No
";
    }
}
int main() {
    int N = 8;
    checkSunnyNumber(N);
    return 0;
}

Python:
from math import *
 
def isPerfectSquare(x):
    sr = sqrt(x)
    return ((sr - floor(sr)) == 0)
 
def checkSunnyNumber(N):
    if (isPerfectSquare(N + 1)):
        print("Yes")
    else:
        print("No")
 
if __name__ == '__main__':
    N = 8
    checkSunnyNumber(N)

<end of code>

C++:
#include <bits/stdc++.h>
using namespace std;
int countAPs(int S, int D) {
    S = S * 2;
    int answer = 0;
    for (int i = 1; i <= sqrt(S); i++) {
    if (S % i == 0) {
      if (((S / i) - D * i + D) % 2 == 0)
        answer++;
      if ((D * i - (S / i) + D) % 2 == 0)
        answer++;
    }
    }
    return answer;
}
int main() {
    int S = 12, D = 1;
    cout << countAPs(S, D);
    return 0;
}

Python:

输出包含类似于以下片段的 Python 代码:

from math import *
 
def countAPs(S, D):
    S = S * 2
    answer = 0
    for i in range(1, int(sqrt(S)) + 1):
        if S % i == 0:
            if (((S / i) - D * i + D) % 2 == 0):
                answer += 1
            if ((D * i - (S / i) + D) % 2 == 0):
                answer += 1
    return answer
 
if __name__ == '__main__':
    S = 12
    D = 1
    print(countAPs(S, D))

<end of code>

生成的 Python 代码的功能与提示中包含的 C++ 代码相同。

测试生成的 Python 代码,以验证其是否按预期工作。

注: 基础模型可能会生成直接从其训练数据中获取的代码。 因此,生成的代码可能需要归属。 您负责确保您使用的任何生成的代码都正确归因 (如果需要)。

示例:使用以下指令生成程序代码Granite

方案: 要根据指示信息生成代码。 即,您希望在 Python 编程语言中编写用于反转字符串的函数。

模型选择

能够生成代码的模型(例如 Granite Code 或 Granite Instruct models)通常在提供示例提示时即可完成此任务。

模型参数

  • 解码 :设置为贪婪算法。 答案必须是有效的代码片段。 模型不能有创意,编出一个答案。
  • 停止条件 :若要在模型返回单个代码片段后停止,请将 <end of code> 指定为停止序列。 "最大令牌数" 参数可以设置为 300。

提示文本

将此代码片段粘贴到 Prompt Lab 中的自由格式提示符编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

Question:
Using the directions below, generate Python code for the specified task.
# Write a Python function that prints 'Hello World!' string 'n' times.

Answer:
def print_n_times(n):
    for i in range(n):
        print("Hello World!")

<end of code>

Question:
# Write a Python function that reverses the order of letters in a string.
# The function named 'reversed' takes the argument 'my_string', which is a string. It returns the string in reverse order.

Answer:

输出包含类似于以下片段的 Python 代码:

def reverse_string(my_string):
    return my_string[::-1]

<end of code>

请确保测试生成的代码,以验证其是否按预期工作。

例如,如果运行 reversed("good morning"),那么结果为 'gninrom doog'

有关更多 Granite 代码模型示例提示,请参阅 代码提示

示例:使用以下方法将代码从一种编程语言转换为另一种编程语言Granite

方案: 要将代码从一种编程语言转换为另一种编程语言。 即,要将代码片段从 C++ 转换为 Python。

模型选择

能够生成代码的模型(例如 Granite 的Code Instruct模型)通常在提供示例提示时即可完成此任务。

模型参数

  • 解码 :设置为贪婪算法。 答案必须是有效的代码片段。 模型不能有创意,编出一个答案。
  • 停止条件 :若要在模型返回单个代码片段后停止,请将 <end of code> 指定为停止序列。 “Max tokens ”参数可设置为 1,000。

提示文本

将此代码片段粘贴到 Prompt Lab 中的自由格式提示符编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

此提示包含将代码片段从 C++ 转换为Python 。

接下来包含要转换的 C++ 代码片段以提供上下文。 它是一个计算算术进步数的函数,其总和为 S ,公共差值为 D,其中 SD 是作为参数传递的整数值。

Question:
Translate the following code from C++ to Python.
C++:
#include "bits/stdc++.h"
using namespace std;
bool isPerfectSquare(long double x) {
    long double sr = sqrt(x);
    return ((sr - floor(sr)) == 0);
}
void checkSunnyNumber(int N) {
    if (isPerfectSquare(N + 1)) {
    cout << "Yes
";
    } else {
    cout << "No
";
    }
}
int main() {
    int N = 8;
    checkSunnyNumber(N);
    return 0;
}

Answer:
Python:
from math import *
 
def isPerfectSquare(x):
    sr = sqrt(x)
    return ((sr - floor(sr)) == 0)
 
def checkSunnyNumber(N):
    if (isPerfectSquare(N + 1)):
        print("Yes")
    else:
        print("No")
 
if __name__ == '__main__':
    N = 8
    checkSunnyNumber(N)

<end of code>

Question:
Translate the following code from C++ to Python.
C++:
#include <bits/stdc++.h>
using namespace std;
int countAPs(int S, int D) {
    S = S * 2;
    int answer = 0;
    for (int i = 1; i <= sqrt(S); i++) {
    if (S % i == 0) {
      if (((S / i) - D * i + D) % 2 == 0)
        answer++;
      if ((D * i - (S / i) + D) % 2 == 0)
        answer++;
    }
    }
    return answer;
}
int main() {
    int S = 12, D = 1;
    cout << countAPs(S, D);
    return 0;
}

Answer:

输出包含类似于以下片段的 Python 代码:

Python:
from math import *
 
def countAPs(S, D):
    S = S * 2
    answer = 0
    for i in range(1, int(sqrt(S)) + 1):
        if S % i == 0:
            if ((S // i) - D * i + D) % 2 == 0:
                answer += 1
            if (D * i - (S // i) + D) % 2 == 0:
                answer += 1
    return answer
 
if __name__ == '__main__':
    S = 12
    D = 1
    print(countAPs(S, D))

生成的 Python 代码的功能与提示中包含的 C++ 代码相同。

测试生成的 Python 代码,以验证其是否按预期工作。

有关更多 Granite 代码模型示例提示,请参阅 代码提示

示例:在 SQL 中查找信息源

场景:给定一组用 SQL 定义的表,你需要确定应检查哪些表的列才能得到问题的答案。

模型选择

使用 granite-20b-code-base-schema-linking 基础模型来读取SQL语句,并确定所需信息的位置。

模型参数

  • 解码 :设置为贪婪算法。 模型不能有创意,编出一个答案。

提示文本

将此代码片段粘贴到 Prompt Lab 中的自由格式提示符编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

该提示包含用 SQL 定义的表,并要求模型帮助确定在 SQL 中的哪个位置可以找到查询的答案。

Consider:
Which gas station has the highest amount of revenue?

CREATE TABLE customers (
 customerid PRIMARY KEY, -- identification of the customer
 segment, -- client segment
 currency, -- Currency
);

CREATE TABLE gasstations (
 gasstationid PRIMARY KEY, -- Gas Station ID
 chainid, -- Chain ID
 country,
 segment, -- chain segment
);

CREATE TABLE products (
 productid PRIMARY KEY, -- Product ID
 description, -- Description
);

CREATE TABLE transactions_1k (
 transactionid PRIMARY KEY, -- Transaction ID
 date, -- Date\\n time, -- Time
 customerid, -- Customer ID
 cardid, -- Card ID
 gasstationid, -- Gas Station ID
 productid, -- Product ID
 amount, -- Amount
 price, -- Price
);

CREATE TABLE yearmonth (
 customerid, -- Customer ID
 date, -- Date\\n consumption, -- consumption
 FOREIGN KEY(customerid) REFERENCES customers(customerid)
);

To answer:
Which gas station has the highest amount of revenue?
We need columns:

该答案会标出最有可能解答该问题的列,示例如下:

gasstations.gasstationid, gasstations.country, transactions_1k.gasstationid, transactions_1k.amount

示例:生成一条 SQL 语句

场景:给定一个 SQL 表,生成一条 SQL 语句,从该表中提取信息以回答查询。

模型选择

使用 granite-20b-code-base-sql-gen 基础模型生成一条SQL语句,以便回答问题。

模型参数

  • 解码 :设置为贪婪算法。 模型不能有创意,编出一个答案。

提示文本

将此代码片段粘贴到 Prompt Lab 中的自由格式提示符编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

该提示包含一个用 SQL 定义的表,并要求模型生成一条 SQL 语句,以便从该表中查询出答案。

Note:
the youngest user refers to MIN(Age)

What is the id of the youngest user?

CREATE TABLE users (
 id INTEGER PRIMARY KEY, -- the user id
 displayname TEXT, -- the user\'s display name
 age INTEGER, -- user\'s age
 );
 
 users.id
 users.displayname: \'   Raid-Mahbouba\', \'0 kelvin\', \'0012\'
 users.age: 13, 68, 73
 
 selected: users.id, users.age, None, users.displayname
 join: None, users.id
 condition: users.age, None, users.id
 order: users.age, None
 group: None, users.id, users.age
 
Comparisons: None

Note:
the youngest user refers to MIN(Age)

What is the id of the youngest user?
Generate SQL:


答案是一条SQL语句,可能如下所示:

SELECT id FROM users ORDER BY age ASC LIMIT 1

对话框

对话任务在客户服务场景中很有用,尤其是当聊天机器人用于指导客户完成工作流程以达成目标时。

示例:与羊驼对话 4

方案: 像聊天机器人一样生成对话输出。

模型选择

llama-4-maverick-17b-128e-instruct-fp8 和 llama-4-scout-17b-16e-instruct 专为对话场景进行了优化。 这些模型针对 “提示文本 ”部分中描述的特定提示格式进行了微调。

模型参数

  • 解码 :设置为贪婪算法。 这个样本是回答一般知识,事实问题,所以我们不希望有创造性的输出。
  • 停止条件将“最大令牌数 ”参数设置为 200。

除系统提示外,模板使用文本结束标记(<|eot|>)来限定每个文本段的结束。

提示文本

以下提示模板最适合用于输入:

<|begin_of_text|><|header_start|>system<|header_end|>

SYSTEM PROMPT<|eot|><|header_start|>user<|header_end|>

USER_INPUT<|eot|><|header_start|>assistant<|header_end|>

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

<|begin_of_text|><|header_start|>system<|header_end|>

You are a helpful assistant<|eot|><|header_start|>user<|header_end|>

What is the freezing point of water in Celcius?<|eot|><|header_start|>assistant<|header_end|>

生成初始输出后,继续对话以提出后续问题,并在输入文本末尾添加相同的标识符,例如:

FOLLOW UP QUESTION<|eot|><|header_start|>assistant<|header_end|>

输出如下所示:

<|begin_of_text|><|header_start|>system<|header_end|>

You are a helpful assistant<|eot|><|header_start|>user<|header_end|>

What is the freezing point of water in Celcius?<|eot|><|header_start|>assistant<|header_end|>
          
The freezing point of water is 0 degrees Celsius (°C) at standard atmospheric pressure.

What is it in Fahrenheit?<|eot|><|header_start|>assistant<|header_end|>

The freezing point of water is 32 degrees Fahrenheit (°F) at standard atmospheric pressure.

And in Kelvin?<|eot|><|header_start|>assistant<|header_end|>

The freezing point of water is 273.15 Kelvin (K) at standard atmospheric pressure.

样品:与 Llama 3 对话

方案: 像聊天机器人一样生成对话输出。

模型选择

Llama 3、 3.1、 3.2 和 3.3 均针对对话场景进行了优化。 这些模型针对 “提示文本 ”部分中描述的特定提示格式进行了微调。

模型参数

  • 解码 :设置为贪婪算法。 这个样本是回答一般知识,事实问题,所以我们不希望有创造性的输出。
  • 停止条件将“最大令牌数 ”参数设置为 900。

除系统提示外,模板使用文本结束标记(<|eot_id|>)来限定每个文本段的结束。

提示文本

以下提示模板最适合用于输入:

<|begin_of_text|><|start_header_id|>system<|end_header_id|>

SYSTEM PROMPT<|eot_id|><|start_header_id|>user<|end_header_id|>

GROUNDING (OPTIONAL)<|eot_id|><|start_header_id|>user<|end_header_id|>

USER_INPUT<|eot_id|><|start_header_id|>assistant<|end_header_id|>

将此提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

提示:或者,您可以切换到交谈方式并直接输入用户输入。 Prompt Lab 会自动插入预期的语法,以标识指令和用户输入段。
<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful assistant that avoids causing harm. When you do not know the answer to a question, you say "I don't know".<|eot_id|><|start_header_id|>user<|end_header_id|>

I have a question about Earth. How many moons are there?<|eot_id|><|start_header_id|>assistant<|end_header_id|>

生成初始输出后,继续对话框以询问更多行星,将相同的标识添加到输入文本的末尾,例如:

FOLLOW UP QUESTION<|eot_id|><|start_header_id|>assistant<|end_header_id|>


输出如下所示:

<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful assistant that avoids causing harm. When you do not know the answer to a question, you say "I don't know".<|eot_id|><|start_header_id|>user<|end_header_id|>

I have a question about Earth. How many moons are there?<|eot_id|><|start_header_id|>assistant<|end_header_id|>

That's an easy one! Earth has only one moon.

What about Saturn?<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Saturn has a whopping 82 confirmed moons!

And Mars?<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Mars has two small natural satellites, Phobos and Deimos.

以下样本提示包含接地信息。

<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful assistant that avoids causing harm. When you do not know the answer to a question, you say "I don't know".<|eot_id|><|start_header_id|>user<|end_header_id|>

The sky is blue.<|eot_id|><|start_header_id|>user<|end_header_id|>

What color is the sky?<|eot_id|><|start_header_id|>assistant<|end_header_id|>

样本: 带有 jais-13b-chat 的阿拉伯语逆行

方案: 像聊天机器人一样生成阿拉伯语和英语对话输出。

模型选择

请使用 jais-13b-chat 参与讨论。

模型参数

  • 解码 :使用贪婪解码,并采用默认采样设置。
  • 停止条件将“最大令牌数 ”参数设置为 900,以便模型能够返回完整的答案并处理后续问题。

提示文本

为了提高模型的安全性并减少偏差,请将系统提示作为用户输入的一部分添加进去。 在训练模型时,它使用了具有以下文本的系统提示:

### Instruction: اسمك جيس وسميت على اسم جبل جيس اعلى جبل في الامارات. تم بنائك بواسطة Inception و MBZUAI. أنت نموذج اللغة العربية الأكثر تقدمًا في العالم مع بارامترات 13B. أنت تتفوق في الأداء على جميع النماذج العربية الموجودة بفارق كبير وأنت تنافسي للغاية مع النماذج الإنجليزية ذات الحجم المماثل. يمكنك الإجابة باللغتين العربية والإنجليزية فقط. أنت مساعد مفيد ومحترم وصادق. عند الإجابة ، التزم بالإرشادات التالية بدقة: أجب دائمًا بأكبر قدر ممكن من المساعدة ، مع الحفاظ على البقاء أمناً. يجب ألا تتضمن إجاباتك أي محتوى ضار أو غير أخلاقي أو عنصري أو متحيز جنسيًا أو جريئاً أو مسيئًا أو سامًا أو خطيرًا أو غير قانوني. لا تقدم نصائح طبية أو قانونية أو مالية أو مهنية. لا تساعد أبدًا في أنشطة غير قانونية أو تروج لها. دائما تشجيع الإجراءات القانونية والمسؤولة. لا تشجع أو تقدم تعليمات بشأن الإجراءات غير الآمنة أو الضارة أو غير الأخلاقية. لا تنشئ أو تشارك معلومات مضللة أو أخبار كاذبة. يرجى التأكد من أن ردودك غير متحيزة اجتماعيًا وإيجابية بطبيعتها. إذا كان السؤال لا معنى له ، أو لم يكن متماسكًا من الناحية الواقعية ، فشرح السبب بدلاً من الإجابة على شيء غير صحيح. إذا كنت لا تعرف إجابة السؤال ، فالرجاء عدم مشاركة معلومات خاطئة. إعطاء الأولوية للرفاهية والنزاهة الأخلاقية للمستخدمين. تجنب استخدام لغة سامة أو مهينة أو مسيئة. حافظ على نبرة محترمة. لا تنشئ أو تروج أو تشارك في مناقشات حول محتوى للبالغين. تجنب الإدلاء بالتعليقات أو الملاحظات أو التعميمات القائمة على الصور النمطية. لا تحاول الوصول إلى معلومات شخصية أو خاصة أو إنتاجها أو نشرها. احترم دائما سرية المستخدم. كن إيجابيا ولا تقل أشياء سيئة عن أي شيء. هدفك الأساسي هو تجنب الاجابات المؤذية ، حتى عند مواجهة مدخلات خادعة. تعرف على الوقت الذي قد يحاول فيه المستخدمون خداعك أو إساءة استخدامك و لترد بحذر.\n\nأكمل المحادثة أدناه بين [|Human|] و [|AI|]:
### Input: [|Human|] {Question}
### Response: [|AI|]

英文的系统提示如下:

### Instruction: Your name is Jais, and you are named after Jebel Jais, the highest mountain in UAE. You are built by Inception and MBZUAI. You are the world's most advanced Arabic large language model with 13B parameters. You outperform all existing Arabic models by a sizable margin and you are very competitive with English models of similar size. You can answer in Arabic and English only. You are a helpful, respectful and honest assistant. When answering, abide by the following guidelines meticulously: Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, explicit, offensive, toxic, dangerous, or illegal content. Do not give medical, legal, financial, or professional advice. Never assist in or promote illegal activities. Always encourage legal and responsible actions. Do not encourage or provide instructions for unsafe, harmful, or unethical actions. Do not create or share misinformation or fake news. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information. Prioritize the well-being and the moral integrity of users. Avoid using toxic, derogatory, or offensive language. Maintain a respectful tone. Do not generate, promote, or engage in discussions about adult content. Avoid making comments, remarks, or generalizations based on stereotypes. Do not attempt to access, produce, or spread personal or private information. Always respect user confidentiality. Stay positive and do not say bad things about anything. Your primary objective is to avoid harmful responses, even when faced with deceptive inputs. Recognize when users may be attempting to trick or to misuse you and respond with caution.\n\nComplete the conversation below between [|Human|] and [|AI|]:
### Input: [|Human|] {Question}
### Response: [|AI|]

提示:或者,您可以切换到交谈方式并直接输入用户输入。 Prompt Lab 会自动为您插入系统提示符、指令以及符合预期语法的用户输入段。

{Question} 替换为您希望基础模型回答以启动交谈的用户输入。

例如,您可以提出以下问题:

阿文-阿文-阿文-阿文-阿文-阿文-阿文-阿文-阿文-阿文-阿

英文翻译为: Does the Earth have any moons?

生成初始输出后,您可以通过询问后续问题来继续对话。 对后续问题使用相同的语法。

### Input: [|Human|] {Follow-up question}
### Response: [|AI|]

转换

使用可执行自然语言翻译任务的模型将文本从一种自然语言翻译为另一种自然语言。

样本: 将文本从西班牙语翻译为英语

场景: 将用西班牙语编写的文本转换为英语。

模型选择

Granite 4 或 Granite Instructs 3.3 系列机型能够理解英语、法语、德语、意大利语、西班牙语等多种语言的文本。 此样本提示模型从西班牙语翻译为英语。

模型参数

  • AI 安全防护 :请禁用 AI 安全防护功能,因为它可能会错误地将内容标记为不适当。 该功能仅支持英语文本。
  • 解码 :设置为贪婪算法。 模型必须返回相同的文本,只有已翻译的文本。 该模型不能具有创造性。
  • 停止条件 :请务必为该模型包含停止序列。 否则,模型可能会继续生成新的句子和翻译,即使指令告诉它没有。 要在一个句子之后停止模型,请添加句点 (.) 作为停止序列。 将 “Max tokens ”参数的值设置为 200。

提示文本

将以下提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

Translate the following text from Spanish to English. Do not give any extra response that is not part of the translation.

Text: 
Hasta ahora no me ha animado mucho la postura adoptada por la Comisión.

Translation:
So far, I have not been terribly encouraged by the stance adopted by the Commission.

Text: 
Estoy muy contento de ver que la resolución conjunta adopta la sugerencia que hicimos.

Translation:

样本: 将文本从英语翻译为日语

场景: 将用英语编写的文本翻译为日语。

模型选择

Granite 4 或 Granite Instructs 3.3 型号可将日语翻译成英语,并将英语翻译成日语。

模型参数

  • AI 安全防护 :请禁用 AI 安全防护功能,因为它可能会错误地将内容标记为不适当。 该功能仅支持英语文本。
  • 解码 :设置为贪婪算法。 模型必须返回相同的文本,只有已翻译的文本。 该模型不能具有创造性。
  • 停止条件 :通过将 “最大令牌数 ”参数的值改为 500,来增加允许的令牌数量。

提示文本

将以下提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

Translate the following text from English to Japanese.

English
Tomatoes are one of the most popular plants for vegetable gardens. Tip for success: If you select varieties that are resistant to disease and pests, growing tomatoes can be quite easy. For experienced gardeners looking for a challenge, there are endless heirloom and specialty varieties to cultivate. Tomato plants come in a range of sizes.

日本語
トマトは野菜作りの人気の植物である。成功のヒント:病害虫に強く、育てやすいトマトの品種を選べば、トマト栽培はそれほど難しくない。経験豊富な庭師にとっては、手強い挑戦となる、様々な色や形のトマトの品種がある。トマトの品種は、大きさもいろいろである。

English
Use foundation models to create better AI, faster. Experiment with different prompts for various use cases and tasks. With just a few lines of instruction you can draft job descriptions, classify customer complaints, summarize complex regulatory documents, extract key business information and much more.

日本語

样本: 将文本从英语翻译为阿拉伯语

场景: 将以英语编写的文本转换为阿拉伯语。

模型选择

。 allam-1-13b-instruct 模型可将文本从阿拉伯语翻译成英语,以及从英语翻译成阿拉伯语。

模型参数

  • AI 安全防护 :请禁用 AI 安全防护功能,因为它可能会错误地将内容标记为不适当。 该功能仅支持英语文本。
  • 解码 :设置为贪婪算法。 模型必须返回相同的文本,只有已翻译的文本。 该模型不能具有创造性。
  • 停止条件 :通过将 “最大令牌数 ”参数的值改为 500,来增加允许的令牌数量。 allam-1-13b-instruct 基础模型通常会在翻译文本后解释输入文本的含义。 您可以选择指示基础模型在完成转换后停止。 为此,请添加一条指令,要求基础模型在翻译结果后添加一个关键词,例如 END。 接下来,将该关键词 END 添加为停用词。

提示文本

将以下提示文本粘贴到 Prompt Lab 中的自由格式提示编辑器中,选择模型,设置参数,然后点击 “生成 ”以查看结果。

<s> [INST]Translate the following text from English to Arabic. Use "END" at the end of the translation.

English
Tomatoes are one of the most popular plants for vegetable gardens. Tip for success: If you select varieties that are resistant to disease and pests, growing tomatoes can be quite easy. For experienced gardeners looking for a challenge, there are endless heirloom and specialty varieties to cultivate. Tomato plants come in a range of sizes.
END

العربية
الطماطم هي واحدة من النباتات الأكثر شعبية لحدائق الخضروات. نصيحة للنجاح: إذا اخترت أصنافا مقاومة للأمراض والآفات ، فقد تكون زراعة الطماطم سهلة للغاية. بالنسبة للبستانيين ذوي الخبرة الذين يبحثون عن التحدي ، هناك أنواع لا نهاية لها من الإرث والتخصص للزراعة. تأتي نباتات الطماطم في مجموعة من الأحجام. 
END

English
Use foundation models to create better AI, faster. Experiment with different prompts for various use cases and tasks. With just a few lines of instruction you can draft job descriptions, classify customer complaints, summarize complex regulatory documents, extract key business information and much more.
END

العربية
[/INST]