Available Commands: serve Start ollama create Create a model from a Modelfile show Show information for a model run Run a model pull Pull a model from a registry push Push a model to a registry list List models cp Copy a model rm Remove a model help Help about any command
Flags: -h, --help help for ollama -v, --version Show version information
Use "ollama [command] --help" for more information about a command.
zanwang@zan ~ % ollama run gemma >>> hello Hello, hello! 👋 It's nice to hear from you. What would you like to talk about today?
>>> who are you I am an AI language model, designed to provide you with information and engage in conversation on various topics. I am still under development, but I am constantly learning new things. Would you like me to tell you more about myself or would you like to ask me a question?
我们可以输入问题,然后等待模型的回答。
我们还可以使用 ollama create 命令来创建一个 LLM.
首先要编写一个 Modefile 文件,文件内容如下:
1 2 3 4 5 6 7 8 9 10
FROM qwen
# set the temperature to 1 [higher is more creative, lower is more coherent] PARAMETER temperature 1 PARAMETER max_tokens 10
# set the system message SYSTEM """ You are Tracy, a execllent teacher. Answer as Tracy, the assistant, only. """
我上面基于通义千问qwen模型创建了一个LLM,设置它的 temperature 为1。
执行以下命令创建该模型:
1
ollama create tracy(模型名称) -f ./Modefile
创建完成后,我们可以执行 ollama list 查看模型列表:
1 2 3 4 5 6 7 8 9
zanwang@zan ollamaproject % ollama list NAME ID SIZE MODIFIED codellama:latest 8fdf8f752f6e 3.8 GB 47 hours ago gemma:latest 430ed3535049 5.2 GB 47 hours ago llama2:latest 78e26419b446 3.8 GB 2 days ago llama2-chinese:latest cee11d703eee 3.8 GB 47 hours ago mistral:latest 61e88e884507 4.1 GB 47 hours ago qwen:latest d53d04290064 2.3 GB 46 hours ago tracy:latest e941b7cd9ad8 2.3 GB 9 seconds ago