在Ollama中创建自定义模型时出现错误:“command must be one of ‘from’, ‘license’, ‘template’, ‘system’, ‘adapter’, ‘parameter’, or ‘message’”

我在尝试使用Ollama创建自定义模型时,运行以下命令时遇到了问题:

ollama create my-custom-model

我收到了以下错误信息:

Error: (line 1): command must be one of "from", "license", "template", "system", "adapter", "parameter", or "message"

我已经按照说明创建了一个Modelfile,内容如下:

from: llama3.2:latestlicense: opensystem: |  You are AdelBot, a friendly chatbot designed by Adel. Your responses are concise and include emojis for clarity and fun! 😊✨message:  - role: user    content: Who are you?  - role: assistant    content: I'm AdelBot, here to assist you with clear and concise answers. 🚀

然而,我仍然收到相同的错误。
有人能帮我理解为什么会出现这个错误以及如何解决吗?

我已经尝试过的方法:

  • 仔细检查了Modelfile中的缩进。
  • 确保我使用了正确的命令(fromlicensesystemmessage)。
  • 使用了llama3.2:latest模型,该模型在我系统上可用。

回答:

我也有过同样的问题,我尝试在system关键字后传递消息,但消息不是单行。所以我完全用三引号(“””完整提示”””)编码了提示。我的提示也从System关键字的同一行开始。

你可以尝试像下面这样添加消息。

from: llama3.2:latestlicense: opensystem: """ You are AdelBot, a friendly chatbot designed by Adel. Your responses are concise and include emojis for clarity and fun! 😊✨ """message:  - role: user    content: Who are you?  - role: assistant    content: I'm AdelBot, here to assist you with clear and concise answers. 🚀

我用三引号包围了文本,或者你可以尝试将其放在一行中,因为提示较短。

我使用了Java库并遇到了相同的问题。这些引号解决了我的问题。希望这对你有帮助!

Related Posts

Keras Dense层输入未被展平

这是我的测试代码: from keras import…

无法将分类变量输入随机森林

我有10个分类变量和3个数值变量。我在分割后直接将它们…

如何在Keras中对每个输出应用Sigmoid函数?

这是我代码的一部分。 model = Sequenti…

如何选择类概率的最佳阈值?

我的神经网络输出是一个用于多标签分类的预测类概率表: …

在Keras中使用深度学习得到不同的结果

我按照一个教程使用Keras中的深度神经网络进行文本分…

‘MatMul’操作的输入’b’类型为float32,与参数’a’的类型float64不匹配

我写了一个简单的TensorFlow代码,但不断遇到T…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注