# 將 Hugging Face 上的模型安裝到 OLlama :::info 以下以 colab 做示範 ::: ## 安裝 huggingface hub ```bash !pip install huggingface-hub ``` ## 下載 Hugging Face 上的模型 本次使用此模型 [mistrallite.Q4_K_M.gguf](https://huggingface.co/TheBloke/MistralLite-7B-GGUF/blob/main/mistrallite.Q4_K_M.gguf) 執行以下下載指令 ``` !huggingface-cli download \ TheBloke/MistralLite-7B-GGUF \ mistrallite.Q4_K_M.gguf \ --local-dir downloads \ --local-dir-use-symlinks False ``` ## 建立 Modelfile.txt 包裝模型檔 Modelfile.txt 的內容如下: FROM 路徑/模型檔名稱.gguf ``` FROM ./downloads/mistrallite.Q4_K_M.gguf ``` 將 Modelfile.txt 存檔 ## 包裝模型檔 ``` !ollama create 自訂模型名稱 -f Modelfile.txt ``` 執行後開始跑 ![image](https://hackmd.io/_uploads/Sy7Q0LuTp.png) 完成畫面 ![image](https://hackmd.io/_uploads/HkwZ0Iup6.png) ## 確認模型存在 執行以下指令查看現有模型是否有剛才下載的模型 ``` !ollama list ``` ![image](https://hackmd.io/_uploads/HJpH08dap.png) ## 使用 colab 實測各大模型 ### 1. Taiwan-LLM-13B-v2.0-chat-Q8_0.gguf 13.8 GB 的台灣語言模型實測結果, 速度龜速, 生成內容很不理想 ![image](https://hackmd.io/_uploads/B1RZ57366.png)