- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试 OpenAI 中给出的这段代码。
代码
import openai
prompt = """We’re releasing an API for accessing new AI models developed by OpenAI. Unlike most AI systems which are designed for one use-case, the API today provides a general-purpose “text in, text out” interface, allowing users to try it on virtually any English language task. You can now request access in order to integrate the API into your product, develop an entirely new application, or help us explore the strengths and limits of this technology."""
response = openai.Completion.create(model="davinci", prompt=prompt, stop="\n", temperature=0.9, max_tokens=100)
print(response)
我遇到了一个错误
错误
"Must provide an 'engine' parameter to create a %s" % cls, "engine".openai.error.InvalidRequestError: Must provide an 'engine' parameter to create a <class 'openai.api_resources.completion.Completion'>
我正在使用 python 3.7.6
最佳答案
您似乎混淆了引擎参数和模型参数。请查看此文档以了解正确的调用方式:https://beta.openai.com/docs/developer-quickstart/python-bindings
请将 model = "davinci"
更改为 engine = "davinci"
你应该可以开始了。
关于python - 无效请求错误 : Must provide an 'engine' parameter while invoking openAI API for text generation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65667929/
我正在尝试查找first_row = [1, 2, 3, 4, ...] 目前,我有 list = [[1, a], [2, b], [3, c], [4, d], ...] 并尝试运行:list[:
我正在尝试查找first_row = [1, 2, 3, 4, ...] 目前,我有 list = [[1, a], [2, b], [3, c], [4, d], ...] 并尝试运行:list[:
我正在尝试构建一个应用程序以提交到 AppStore.. 每次我尝试构建它时,我都会在验证期间收到一条警告: The dwarfdump binary must exist and must be e
我正在关注这个“ Hello World ”教程: https://steemit.com/eos/@skenan/eos-development-for-beginners-webassembly
所以有点背景。我一直在尝试在 CentOS 6 机器上设置 Hive。我按照这个 Youtube 视频的说明操作:http://www.youtube.com/watch?v=L2lSrHsRpOI
我是 graphQL 新手,我正在尝试在后端的resolvers.js 文件下更新用户配置文件密码,但我已经坚持了一段时间,并且不断收到相同的错误消息。 resolvers.js updatePass
我有一个程序正在使用用户指定的测量值来计算矩形的面积。出于特定原因,我正在使用一个类来执行此操作,但是我的编译器会生成两个错误... expression must have class type l
在处理数据结构类的图类时,我遇到了边缘对象问题: myGraph.nodes[a]->edges.back.n1 = myGraph.nodes[a]; myGraph
我正在将此方法添加到公共(public)静态类 public static LogMessage(Exception ex) { Trace.WriteLine(ex.
我经常用 Cache-Control: no-cache 或 Cache-Control: max-age=0 规范说must-revalidate是为了max-stale...(服务器问题max-s
每当从列出的类中运行下面的行时,我在版本 2017.2.0f3 和 2017.2.1f1 中遇到此错误,但它在 5.5.0.f3 中完美运行 WWW request = new WWW(m_host,
我已经在我的 Ubuntu EC2 实例上安装了 Hadoop,并按照本教程完成了安装 hive 的所有步骤:http://www.tutorialspoint.com/hive/hive_insta
您好,在此先感谢您的帮助! 当我尝试执行从 GitHub 提取的时间序列分解时,出现ValueError: You must specify a period or x must be a panda
为了寻求有关问题的建议和帮助,我在运行 Xubuntu Linux 16.04 LTS 的笔记本电脑上新安装了 Oracle XE。我关注了this发布我的安装。 在 Oracle XE 安装位置 /
当通过 AD 帐户登录时,我在尝试在 C# MVC Web 应用程序中加载 p12 证书文件时遇到问题。 我们在加载证书时遇到的错误是:必须信任计算机才能进行委托(delegate),并且当前用户帐户
我想使用 IOptions 通过 POCO 获取配置,但它会抛出错误消息“模型绑定(bind)的复杂类型不能是抽象类型或值类型,并且必须具有无参数构造函数” DatabaseSettings.cs p
正确执行加法模型有一些问题。 我有那个数据框: 当我运行此代码时: import statsmodels as sm import statsmodels.api as sm decompositio
感谢有关 tutorialspoint 和 stackoverflow 的有用信息,我几乎完成了在 Oracle VirtualBox 上的 Ubuntu 上安装 Hive 3.1.1 和 Hadoo
这是我用于测试目的的简单代码。 boolean isMoving(){ if (a == b) { return true; } else if (a != b) {
如果我的模型中有这样的属性: [BindProperty] public IPagedList Products { get; set; } 然后当我尝试发布时,我收到此错误: An
我是一名优秀的程序员,十分优秀!