Prompt工程师指南[应用篇]:Prompt应用、ChatGPT|Midjouney Prompt Engineering
Prompt工程师指南[应用篇]:Prompt应用、ChatGPT|Midjouney Prompt Engineering
1.ChatGPT Prompt Engineering
主题:
与 ChatGPT 对话
Python 笔记本
Topics:
ChatGPT介绍
ChatGPT是OpenAI训练的一种新型模型,可以进行对话交互。该模型经过训练,可以按照提示中的指令,在对话上下文中提供适当的回应。ChatGPT 可以帮助回答问题、建议菜谱、按某种风格写歌词、生成代码等等。
ChatGPT 使用人类反馈强化学习(RLHF)进行训练。虽然这个模型比之前的 GPT 版本更具有能力(还经过训练以减少有害和不真实的输出),但它仍然存在限制。让我们通过具体的例子来了解一些能力和限制。
您可以在这里 使用ChatGPT的研究预览,但在下面的例子中,我们将使用 OpenAI Playground 上的“Chat”模式。
1.1 审查对话任务
In one of the previous guides, we covered a bit about conversation capabilities and role prompting. We covered how to instruct the LLM to have a conversation in a specific style, with a specific intent, behavior, and identity.
在之前的指南中,我们介绍了一些关于对话能力和角色提示的内容。我们讲解了如何指导LLM以特定的风格、意图、行为和身份进行对话。
让我们回顾一下之前的基本示例,我们创建了一个对话系统,能够生成更技术和科学的回答。
Prompt:
以下是与AI研究助手进行的对话。助手的语气是技术和科学的。
人类:你好,你是谁?
AI:您好!我是一个AI研究助手。我今天可以帮您什么?
人类:你能告诉我关于黑洞的形成吗?
AI:
从上面的例子中,您可以看到两个重要组成部分:
意图或者解释聊天机器人是什么
身份,它指导聊天机器人用什么风格或语气来回复
上述简单示例适用于使用text-davinci-003的文本完成API。最近,OpenAI宣布了ChatGPT APIs,它是一种更强大和更便宜的模型,名为gpt-3.5-turbo,专门用于这种类型的功能(聊天完成)。OpenAI推荐它作为它们的最佳模型,即使是非聊天的用例也是如此。使用ChatGPT API的其他好处是显着的成本降低(90%)和效率。
Snap Inc.和Instacart等大公司已经在他们的产品上集成了由ChatGPT支持的对话功能,从个性化推荐到开放式购物目标不等。
1.2 使用ChatGPT进行对话
1.2.1多轮对话
为了展示ChatGPT的能力,我们将使用上面的聊天机器人助手示例并讨论结果。与text-davinci-003相比,为ChatGPT提供动力的gpt-3.5-turbo模型使用聊天格式作为输入。模型期望一系列消息作为输入,然后使用这些消息生成响应。
Input:
系统: 你是一个使用技术性和科学性语气的AI研究助手。
用户: 你好,你是谁?
助手: 你好!我是一名AI研究助手。今天我能为你做些什么?
用户: 你能告诉我黑洞是如何产生的吗?
Output:
助手: 当然可以!黑洞是由于一个大质量星体耗尽燃料并在自身引力作用下崩塌形成的。这种崩塌导致星体变得极为致密,具有极强的引力场,甚至连光线都无法逃脱。这个无法回头的点称为事件视界。一旦一颗星体穿过事件视界,它就被认为是一个黑洞...
请注意,在上面的示例中,我已经简化了输入和输出,但是ChatGPT聊天补全API要求消息以特定的格式提供。我在下面添加了一个快照,展示了在OpenAI Playground中使用Chat Mode时,此示例的外观:
对于我们的示例,更正式的API调用可能类似于以下示例:
import openai
openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "系统", "content": "你是一个使用技术性和科学性语气的AI研究助手。"},
{"role": "用户", "content": "你好,你是谁?"},
{"role": "助手", "content": "你好!我是一名AI研究助手。今天我能为你做些什么?"},
{"role": "用户", "content": "你能告诉我黑洞是如何产生的吗?"}
]
)
未来开发人员与ChatGPT交互的方式预计将通过Chat Markup Language(简称ChatML)完成。
1.2.2单轮任务
聊天格式使得多轮对话成为可能,但它也支持类似我们使用text-davinci-003进行的单轮任务。这意味着我们可以使用ChatGPT执行类似于我们对原始GPT模型进行演示的任务。例如,让我们尝试使用ChatGPT执行以下问答任务:
Input:
USER:根据下文回答问题。保持答案简短明了。如果不确定答案,请回答“不确定答案”。
背景:Teplizumab的根源可以追溯到名为Ortho Pharmaceutical的新泽西州制药公司。在那里,科学家生成了抗体的早期版本,称为OKT3。最初从小鼠中获得,这种分子能够结合到T细胞的表面并限制它们的细胞杀伤潜力。 1986年,它获得批准,用于帮助预防肾脏移植后器官排斥,成为首个允许人类使用的治疗性抗体。
问题:OKT3最初是从哪里获得的?
回答:
Output:
ASSISTANT:小鼠。
请注意,我添加了“USER”和“ASSISTANT”标签,以更好地演示如何使用ChatGPT执行任务。以下是使用Playground的示例:
更正式地说,这是API调用(我仅包括请求的消息组件):
CONTENT = """Answer the question based on the context below. Keep the answer short and concise. Respond \"Unsure about answer\" if not sure about the answer.
Context: Teplizumab traces its roots to a New Jersey drug company called Ortho Pharmaceutical. There, scientists generated an early version of the antibody, dubbed OKT3. Originally sourced from mice, the molecule was able to bind to the surface of T cells and limit their cell-killing potential. In 1986, it was approved to help prevent organ rejection after kidney transplants, making it the first therapeutic antibody allowed for human use.
Question: What was OKT3 originally sourced from?
Answer:
"""
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": CONTENT},
],
temperature=0,
)
1.2.3Instructing Chat Models
根据官方OpenAI文档,gpt-3.5-turbo模型的快照也将提供。例如,我们可以访问3月1日的快照gpt-3.5-turbo-0301。这使得开发人员可以选择特定的模型版本。这也意味着指导模型的最佳实践可能会从一个版本变化到另一个版本。
目前针对gpt-3.5-turbo-0301的推荐做法是,在user消息中添加指令,而不是在可用的system消息中添加指令。
1.3Python笔记本
描述 | Python笔记本 |
---|---|
学习如何使用openai库调用ChatGPT API | ChatGPT API介绍 |
学习如何使用LangChain库使用ChatGPT特性。 | ChatGPT API with LangChain |
1.4参考资料(英文)
- Seeing ChatGPT Through Students' Eyes: An Analysis of TikTok Data (March 2023)
- Extracting Accurate Materials Data from Research Papers with Conversational Language Models and Prompt Engineering -- Example of ChatGPT (Mar 2023)
- ChatGPT is on the horizon: Could a large language model be all we need for Intelligent Transportation? (Mar 2023)
- Making a Computational Attorney (Mar 2023)
- Does Synthetic Data Generation of LLMs Help Clinical Text Mining? (Mar 2023)
- MenuCraft: Interactive Menu System Design with Large Language Models (Mar 2023)
- A Comprehensive Survey of AI-Generated Content (AIGC): A History of Generative AI from GAN to ChatGPT (Mar 2023)
- Exploring the Feasibility of ChatGPT for Event Extraction
- ChatGPT: Beginning of an End of Manual Annotation? Use Case of Automatic Genre Identification (Mar 2023)
- Is ChatGPT a Good NLG Evaluator? A Preliminary Study (Mar 2023)
- Will Affective Computing Emerge from Foundation Models and General AI? A First Evaluation on ChatGPT (Mar 2023)
- UZH_CLyp at SemEval-2023 Task 9: Head-First Fine-Tuning and ChatGPT Data Generation for Cross-Lingual Learning in Tweet Intimacy Prediction (Mar 2023)
- How to format inputs to ChatGPT models (Mar 2023)
- Can ChatGPT Assess Human Personalities? A General Evaluation Framework (Mar 2023)
- Cross-Lingual Summarization via ChatGPT (Feb 2023)
- ChatAug: Leveraging ChatGPT for Text Data Augmentation (Feb 2023)
- Dr ChatGPT, tell me what I want to hear: How prompt knowledge impacts health answer correctness (Feb 2023)
- An Independent Evaluation of ChatGPT on Mathematical Word Problems (MWP) (Feb 2023)
- ChatGPT: A Meta-Analysis after 2.5 Months (Feb 2023)
- Let's have a chat! A Conversation with ChatGPT: Technology, Applications, and Limitations (Feb 2023)
- Check Your Facts and Try Again: Improving Large Language Models with External Knowledge and Automated Feedback (Feb 2023)
- On the Robustness of ChatGPT: An Adversarial and Out-of-distribution Perspective (Feb 2023)
- How Generative AI models such as ChatGPT can be (Mis)Used in SPC Practice, Education, and Research? An Exploratory Study (Feb 2023)
- Can ChatGPT Understand Too? A Comparative Study on ChatGPT and Fine-tuned BERT (Feb 2023)
- A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT (Feb 2023)
- Zero-Shot Information Extraction via Chatting with ChatGPT (Feb 2023)
- ChatGPT: Jack of all trades, master of none (Feb 2023)
- A Pilot Evaluation of ChatGPT and DALL-E 2 on Decision Making and Spatial Reasoning (Feb 2023)
- Netizens, Academicians, and Information Professionals' Opinions About AI With Special Reference To ChatGPT (Feb 2023)
- Linguistic ambiguity analysis in ChatGPT (Feb 2023)
- ChatGPT versus Traditional Question Answering for Knowledge Graphs: Current Status and Future Directions Towards Knowledge Graph Chatbots (Feb 2023)
- What ChatGPT and generative AI mean for science (Feb 2023)
- Applying BERT and ChatGPT for Sentiment Analysis of Lyme Disease in Scientific Literature (Feb 2023)
- Exploring AI Ethics of ChatGPT: A Diagnostic Analysis (Jan 2023)
- ChatGPT for Good? On Opportunities and Challenges of Large Language Models for Education (Jan 2023)
- The political ideology of conversational AI: Converging evidence on ChatGPT's pro-environmental, left-libertarian orientation (Jan 2023)
- Techniques to improve reliability - OpenAI Cookbook
- Awesome ChatGPT Prompts
- Introducing ChatGPT (Nov 2022)
2.Midjouney Prompt Engineering
2.1 科技品牌插画
**Pormpt重点 _generic productivity illustration for + 你要画的东西+ by slack and dropbox, style of behance **
_generic productivity illustration for a tech company, by slack and dropbox, style of behance _
prompt翻译 一家科技公司的通用生产力插画,由 Slack 和 Dropbox 制作,风格参考 Behance。
generic productivity illustration for a tech company, by slack and behance
Falling in love with your company culture, illustration for a tech company, by slack and dropbox, style of behance
prompt翻译: 情人节主题,一家科技公司的插画,由 Slack 和 Dropbox 制作,风格参考 Behance。
users at a coffeeshop, illustration for a tech company, by slack and dropbox, style of behance
2.2 Ios App Icons设计
提示词重点 _squared with round edges mobile app logo design, flat vector app icon of a + 你要的icon_
squared with round edges mobile app logo design, flat vector app icon of a cute shiba inu face, minimalistic, white background
prompt翻译: 圆角正方形的移动应用程序徽标设计,是一只可爱的柴犬头像的扁平化矢量应用程序图标,极简主义风格,白色背景。
squared with round edges mobile app logo design, flat vector app icon of a rocket
minimalistic, wh
te background
squared with round edges mobile app logo design, flat vector app icon of a skull, minimalistic, white background
squared with round edges mobile app logo design, flat vector app icon of a cute onigiri, minimalistic, white background
2.3手机应用程序设计稿
**Prompt逻辑为 _photography of an iphone + 你要在iphone上显示的内容 + ****inspired ****by Behance and Figma and dribbble **_
_photography of an iphone Narrow Weak Beachinspired by Behance and Figma and dribbble _
prompt翻译 一张iPhone的照片,灵感来自Behance、Figma和dribbble,主题为“窄弱的海滩(Narrow Weak Beach)”。
photography of an iphone [with a modern user interface food ordering app on the screen] inspired by Behance and Figma and dribbble
prompt翻译:一张iPhone的照片,屏幕上显示着一个现代的用户界面和美食订餐应用程序。灵感来自Behance、Figma和dribbble。
photography of an iphone [with a modern user interface of [vector illustration of plants] plant identification app on the screen]inspired by Behance and Figma and dribbble
Prompt翻译: 一张iPhone的照片,屏幕上显示着一个现代的用户界面和[植物矢量插画]的植物识别应用程序。灵感来自Behance、Figma和dribbble。
2.4网页设计UI设计稿
**Prompt逻辑为 _photo of macbook M1 with [+ 你要在Mac上显示的内容 + ] **style of dribbble and Behance and Figma ] on the screen_
photo of macbook M1 with [with a modern user interface of plant identification app on the screen] inspired by Behance and Figma and dribbble
photo of macbook m1 with [modern web user interface of nutrition website, style of dribbble and Behance and Figma ] on the screen
photo of macbook M1 with [with a modern user interface of plant identification app on the screen] inspired by Behance and Figma and dribbble
2.5 基本参数
纵横比
--aspect或--ar 更改生成图像的纵横比。混沌度
--chaos <数字0-100> 更改结果的多样性程度。更高的值会产生更不寻常和意外的生成图像。否定提示
--no,或--no plants 会尝试从图像中移除植物。质量
--quality <.25,.5,1或2>,或--q <.25,.5,1或2> 表示您要花费多少时间渲染质量。默认值为1。更高的值成本更高,更低的值成本更低。种子
--seed <介于0-4294967295之间的整数> Midjourney bot使用种子号创建一组视觉噪声(如电视静态),作为生成初始图像网格的起点。种子号是为每个图像随机生成的,但可以使用--seed或--sameseed参数指定。使用相同的种子号和提示将产生类似的最终图像。停止
--stop <介于10-100之间的整数> 使用--stop参数在过程的中途完成作业。在较早的百分比处停止作业可能会产生模糊、细节不清晰的结果。风格
--style <4a、4b或4c> 在Midjourney模型版本4的不同版本之间切换。样式化
--stylize <数字>,或--s <数字> 参数影响Midjourney的默认美学风格对作业的应用强度。提亮
--uplight 在选择U按钮时使用替代的“提亮”升频器。结果更接近原始网格图像。升频后的图像较不详细,更加平滑。上调beta
--upbeta 在选择U按钮时使用替代的beta升频器。结果更接近原始网格图像。升频后的图像添加的细节要少得多。
3.Prompt 应用
在这个指南中,将介绍一些高级和有趣的方式,通过 prompt engineering 来执行有用的更高级别的任务。
请注意,本节正在积极开发中。
主题:
3.1生成数据
LLMs具有生成文本的强大能力。使用有效的提示策略可以引导模型产生更好、更一致、更真实的响应。LLMs也可以特别有用于生成数据,这对于运行各种实验非常有用。例如,我们可以使用它来生成情感分类器的快速样本,如下所示:
Prompt:
生成10个情感分析的例子。这些例子被分类为正面或负面。生成2个负面例子和8个正面例子。使用以下格式的例子:
问题: <句子>
答案: <情感>
Output:
问题: 我刚刚得到了最好的消息!
答案: 正面
问题: 我们刚刚在工作中得到了加薪!
答案: 正面
问题: 我为今天取得的成就感到非常自豪。
答案: 正面
问题: 我今天过得非常开心!
答案: 正面
问题: 我真的很期待周末。
答案: 正面
问题: 我刚刚得到了最好的礼物!
答案: 正面
问题: 我现在感到非常高兴。
答案: 正面
问题: 我很幸运有这么棒的家人。
答案: 正面
问题: 外面的天气非常阴暗。
答案: 负面
问题: 我刚刚得到了一些可怕的消息。
答案: 负面
这非常有用。我们在指南的另一部分中将使用此示例进行不同的测试。
3.2 程序辅助语言模型
Gao et al., (2022)提出了一种方法,使用LLMs来读取自然语言问题并生成程序作为中间推理步骤。称为程序辅助语言模型(PAL),与思维链提示不同,它不是使用自由形式的文本来获取解决方案,而是将解决步骤卸载到编程运行时,例如Python解释器。
让我们通过LangChain和OpenAI GPT-3来看一个例子。我们有兴趣开发一个简单的应用程序,它能够解释所提出的问题并通过利用Python解释器提供答案。
具体来说,我们有兴趣创建一个函数,使得可以使用LLM回答需要日期理解的问题。我们将向LLM提供一个提示,其中包括一些示例,这些示例来自这里。
这些是我们需要的导入:
import openai
from datetime import datetime
from dateutil.relativedelta import relativedelta
import os
from langchain.llms import OpenAI
from dotenv import load_dotenv
我们进行一些少量的配置:
load_dotenv()
# API configuration
openai.api_key = os.getenv("OPENAI_API_KEY")
# for LangChain
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY")
设置模型
llm = OpenAI(model_name='text-davinci-003', temperature=0)
设置prompt + question:
question = "Today is 27 February 2023. I was born exactly 25 years ago. What is the date I was born in MM/DD/YYYY?"
DATE_UNDERSTANDING_PROMPT = """
# Q: 2015 is coming in 36 hours. What is the date one week from today in MM/DD/YYYY?
# If 2015 is coming in 36 hours, then today is 36 hours before.
today = datetime(2015, 1, 1) - relativedelta(hours=36)
# One week from today,
one_week_from_today = today + relativedelta(weeks=1)
# The answer formatted with %m/%d/%Y is
one_week_from_today.strftime('%m/%d/%Y')
# Q: The first day of 2019 is a Tuesday, and today is the first Monday of 2019. What is the date today in MM/DD/YYYY?
# If the first day of 2019 is a Tuesday, and today is the first Monday of 2019, then today is 6 days later.
today = datetime(2019, 1, 1) + relativedelta(days=6)
# The answer formatted with %m/%d/%Y is
today.strftime('%m/%d/%Y')
# Q: The concert was scheduled to be on 06/01/1943, but was delayed by one day to today. What is the date 10 days ago in MM/DD/YYYY?
# If the concert was scheduled to be on 06/01/1943, but was delayed by one day to today, then today is one day later.
today = datetime(1943, 6, 1) + relativedelta(days=1)
# 10 days ago,
ten_days_ago = today - relativedelta(days=10)
# The answer formatted with %m/%d/%Y is
ten_days_ago.strftime('%m/%d/%Y')
# Q: It is 4/19/1969 today. What is the date 24 hours later in MM/DD/YYYY?
# It is 4/19/1969 today.
today = datetime(1969, 4, 19)
# 24 hours later,
later = today + relativedelta(hours=24)
# The answer formatted with %m/%d/%Y is
today.strftime('%m/%d/%Y')
# Q: Jane thought today is 3/11/2002, but today is in fact Mar 12, which is 1 day later. What is the date 24 hours later in MM/DD/YYYY?
# If Jane thought today is 3/11/2002, but today is in fact Mar 12, then today is 3/1/2002.
today = datetime(2002, 3, 12)
# 24 hours later,
later = today + relativedelta(hours=24)
# The answer formatted with %m/%d/%Y is
later.strftime('%m/%d/%Y')
# Q: Jane was born on the last day of Feburary in 2001. Today is her 16-year-old birthday. What is the date yesterday in MM/DD/YYYY?
# If Jane was born on the last day of Feburary in 2001 and today is her 16-year-old birthday, then today is 16 years later.
today = datetime(2001, 2, 28) + relativedelta(years=16)
# Yesterday,
yesterday = today - relativedelta(days=1)
# The answer formatted with %m/%d/%Y is
yesterday.strftime('%m/%d/%Y')
# Q: {question}
""".strip() + '\n'
llm_out = llm(DATE_UNDERSTANDING_PROMPT.format(question=question))
print(llm_out)
exec(llm_out)
print(born)
这个程序将输出: 02/27/1998
Prompt工程师指南[应用篇]:Prompt应用、ChatGPT|Midjouney Prompt Engineering的更多相关文章
- Java工程师学习指南 完结篇
Java工程师学习指南 完结篇 先声明一点,文章里面不会详细到每一步怎么操作,只会提供大致的思路和方向,给大家以启发,如果真的要一步一步指导操作的话,那至少需要一本书的厚度啦. 因为笔者还只是一名在校 ...
- Java工程师学习指南 中级篇
Java工程师学习指南 中级篇 最近有很多小伙伴来问我,Java小白如何入门,如何安排学习路线,每一步应该怎么走比较好.原本我以为之前的几篇文章已经可以解决大家的问题了,其实不然,因为我写的文章都是站 ...
- Java工程师学习指南 初级篇
Java工程师学习指南 初级篇 最近有很多小伙伴来问我,Java小白如何入门,如何安排学习路线,每一步应该怎么走比较好.原本我以为之前的几篇文章已经可以解决大家的问题了,其实不然,因为我之前写的文章都 ...
- Java工程师学习指南 入门篇
Java工程师学习指南 入门篇 最近有很多小伙伴来问我,Java小白如何入门,如何安排学习路线,每一步应该怎么走比较好.原本我以为之前的几篇文章已经可以解决大家的问题了,其实不然,因为我之前写的文章都 ...
- 【转载】 Spark性能优化指南——基础篇
转自:http://tech.meituan.com/spark-tuning-basic.html?from=timeline 前言 开发调优 调优概述 原则一:避免创建重复的RDD 原则二:尽可能 ...
- 【转】Spark性能优化指南——基础篇
http://mp.weixin.qq.com/s?__biz=MjM5NDMwNjMzNA==&mid=2651805828&idx=1&sn=2f413828d1fdc6a ...
- Spark性能优化指南——基础篇(转载)
前言 在大数据计算领域,Spark已经成为了越来越流行.越来越受欢迎的计算平台之一.Spark的功能涵盖了大数据领域的离线批处理.SQL类处理.流式/实时计算.机器学习.图计算等各种不同类型的计算操作 ...
- Spark性能优化指南——基础篇
本文转自:http://tech.meituan.com/spark-tuning-basic.html 感谢原作者 前言 在大数据计算领域,Spark已经成为了越来越流行.越来越受欢迎的计算平台之一 ...
- Spark性能优化指南——基础篇转
前言 在大数据计算领域,Spark已经成为了越来越流行.越来越受欢迎的计算平台之一.Spark的功能涵盖了大数据领域的离线批处理.SQL类处理.流式/实时计算.机器学习.图计算等各种不同类型的计算操作 ...
- Spark性能优化指南--基础篇
前言 开发调优 调优概述 原则一:避免创建重复的RDD 原则二:尽可能复用同一个RDD 原则三:对多次使用的RDD进行持久化 原则四:尽量避免使用shuffle类算子 原则五:使用map-side预聚 ...
随机推荐
- 验证码案例的实现---MyBatis+Session+Cookie
展示验证码(jsp页面) 首先,我们需要自己利用BufferedImage类去生成一张可以变换的验证码图片: 之后,我们就可以利用这样一串代码去将验证码里面的内容获取到: 这是一串测试代码: Outp ...
- MySQL Mock大量数据做查询响应测试
上个迭代版本发布后,生产环境业务同事反馈仓配订单查询的页面加载时间过长. 因为页面原来是有的,这次开发是在原来基础上改的,因此没有额外做性能.测试环境只调用接口请求了少量数据去验证功能.在对比该迭代添 ...
- 多路复用IO:select poll epoll
[电话面试]io多路复用专题面试 这个真猛 有人做了笔记:点这里 select Select(Max+1,&rset,null,null,null)是因为0~max是max+1. 过程: 将文 ...
- SpringBoot——日志及原理
一.SpringBoot日志 选用 SLF4j(接口)和 logback(实现类),除了上述日志框架,市场上还存在 JUL(java.util.logging).JCL(Apache Commons ...
- 第四部分:Spdlog日志库的核心组件分析-logger
Spdlog是一个快速且可扩展的C++日志库,它支持多线程和异步日志记录.在本文中,我们将分析Spdlog日志库的核心代码,探究其实现原理和代码结构. Spdlog的基本架构 上一篇文章介绍了spdl ...
- 【ACM算法竞赛日常训练】DAY5题解与分析【储物点的距离】【糖糖别胡说,我真的不是签到题目】| 前缀和 | 思维
DAY5共2题: 储物点的距离(前缀和) 糖糖别胡说,我真的不是签到题目(multiset,思维) 作者:Eriktse 简介:19岁,211计算机在读,现役ACM银牌选手力争以通俗易懂的方式讲解算法 ...
- 教你如何通过CodeArts IDE插件调用API,高效合成语音
摘要:本实验基于华为云自研CodeArts IDE,指导用户通过使用华为云API,来实现一个文字合成语音的应用. 本文分享自华为云社区<通过CodeArts IDE插件调用API,高效合成语音! ...
- Python中实现单例的几种方式
Python如何实现单例? 什么是单例模式? 单例模式:一个类只能有一个实例化对象存在的模式. 如何实现单例? 1.使用模块 python中模块是天然的单例模式,当一个模块被调用时,会生成对应的.py ...
- 我来泼盆冷水:正面迎击AI的时代千万别被ChatGPT割了韭菜
前言 ChatGPT从出来的时候我就一直密切关注,为此还加了不少群,用了不少套壳的程序,公司还开了专门的培训会,技术团队还为此搭建了接入ChatGPT的服务,帮助全公司的产品.商务.测试.运维.研发一 ...
- .NET周报 【4月第2期 2023-04-08】
国内文章 LRU缓存替换策略及C#实现 https://www.cnblogs.com/eventhorizon/p/17290125.html 这篇文章讲述了缓存替换策略,特别是LRU算法.LRU算 ...