在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

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

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