paulwong

          微調llama3大模型(2) - 使用ollama搭建chatbot

          上篇已經合并出了訓練好的大模型,現在要搭建起一套CHATBOT,使得這套大模型能有一個WEBUI用起來。

          1.設置環境變量,ollama的模型保存路徑,/etc/profile

          export OLLAMA_MODELS=/root/autodl-tmp/models/ollama

          2.克隆ollama代碼

          curl -fsSL https://ollama.com/install.sh | sh

          3.啟動ollama

          ollama serve

          4.建立ollama鏡像的配置文件,Modelfile

          # set the base model
          FROM /root/.ollama/llamafactory-export/saves/llama3-8b/lora/docker-commnad-nlp/export

          # set custom parameter values
          PARAMETER temperature 
          1
          PARAMETER num_keep 
          24
          PARAMETER stop <|start_header_id|>
          PARAMETER stop <|end_header_id|>
          PARAMETER stop <|eot_id|>
          PARAMETER stop <|reserved_special_token

          # set the model template
          TEMPLATE 
          """
          {{ if .System }}<|start_header_id|>system<|end_header_id|>
          {{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>
          {{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>
          {{ .Response }}<|eot_id|>
          """

          # set the system message
          SYSTEM You are llama3 from Meta
          , customized and hosted @ Paul Wong (http://paulwong88.tpddns.cn).

          # set Chinese lora support
          #ADAPTER /root/.ollama/models/lora/ggml-adapter-model.bin
          建立鏡像命令,create-ollama-image-docker-command-nlp.sh
          BIN_PATH=$(cd `dirname $0`; pwd)
          cd $BIN_PATH/
          pwd
          ollama create llama3-docker-commnad-nlp:paul -f Modelfile

          5.運行大模型

          llama3-docker-commnad-nlp:paul

          posted on 2024-07-08 19:48 paulwong 閱讀(128) 評論(0)  編輯  收藏 所屬分類: AI-LLMAI-FINE-TUNNING

          主站蜘蛛池模板: 开化县| 寻乌县| 辉县市| 嫩江县| 宜阳县| 黔江区| 含山县| 康马县| 太谷县| 蓬溪县| 明溪县| 登封市| 杭锦后旗| 正定县| 蚌埠市| 孟州市| 嘉鱼县| 香格里拉县| 五峰| 洛扎县| 攀枝花市| 盈江县| 东源县| 汨罗市| 理塘县| 衡东县| 天长市| 军事| 米易县| 梁山县| 运城市| 桐梓县| 大连市| 商南县| 逊克县| 岳阳县| 泾阳县| 交城县| 安远县| 万盛区| 尼木县|