åæãšæ³šæäºé
ãã®èšäºã§ã¯ä»¥äžãåæãšããŠããŸãã
- æ€èšŒãã macOS ã®ããŒãžã§ã³ã¯ Sonoma 14.0
- æ€èšŒæ©ã¯ Macbookpro M1 Pro 2021 ã®ã¡ã¢ãª 32GB ã¢ãã«ã«ãªããŸãã
ãã®èšäºã®ãŽãŒã«
以äžã®ããã« macOS ã®ã¿ãŒããã«ã§ Llama3 ã«ã€ããŠè³ªåããŠåçãåŸãããç°å¢ãæ§ç¯ããããšããŽãŒã«ãšããŸãã
>>> how are you ?
Im just an AI, so I don't have emotions like humans do. However, I'm functioning
properly and ready to assist you with any questions or tasks you may have. How can
I help you today?
æ¥æ¬èªã§ã®è³ªåã«ãåçããŠãããŸãããLlama3 ãã®ãŸãŸã§ã¯è±èªã§ã®åçããããŸãã
>>> æ¥æ¬ã®éŠéœã¯ã©ãã§ããïŒ
Thatâs an easy one! ð The capital of Japan is Tokyo (, TokyÅ).
Ollama ã«ã€ããŠ
Ollama ã¯ãAI ã¢ãã«ãç°¡åã«ããŠã³ããŒãããŠå®è¡ã§ããããŒã«ã§ããOllama ã䜿ãããšã§ãAI ã¢ãã«ãããŠã³ããŒãããŠå®è¡ããããã®ç°å¢ãæ§ç¯ããããšãã§ããŸããèšäºå·çæç¹ã§ã¯ãWindowsïŒãã¬ãã¥ãŒçïŒãmacOSãLinux ã«å¯Ÿå¿ããŠããŸãã 以äžã Ollama ã®å ¬åŒãµã€ãã§ãã
ã³ãŒããå ¬éãããŠããã以äžã GitHub ãªããžããªã«ãªããŸãã
æ¬èšäºã§ã¯ãOllama ã䜿ã£ãŠ macOS 㧠Meta 瀟ãå ¬éããŠãããªãŒãã³ãœãŒã¹ã® AI ã¢ãã«ã§ãã Llama3 ãåãããŸã§ã®æé ã解説ããŸãã
Ollama ãã€ã³ã¹ããŒã«ãã
ãŸãOllama ã®å
¬åŒãµã€ãã§Download
ãã¿ã³ãã¯ãªãã¯ããŸãã
以äžã®ããã«è¡šç€ºãããã®ã§ãä»åã¯Download for macOS
ãã¿ã³ãã¯ãªãã¯ã㊠macOS çšã®ãã®ãããŠã³ããŒãããŸãã
èšäºå·çæç¹ã§ã¯Ollama-darwin.zip
ãšãããã¡ã€ã«ãããŠã³ããŒããããŸãããµã€ãºã¯ 184.3MB ã§ããããããããã«ã¯ãªãã¯ããŠã¢ãŒã«ã€ããŠãŒãã£ãªãã£ã§å±éããŸããïŒããã«ã¯ãªãã¯ããŠãå±éã§ããªãå Žåã¯ãZip ãã¡ã€ã«äžã§å³ã¯ãªã㯠âããã®ã¢ããªã±ãŒã·ã§ã³ã§éããâãã¢ãŒã«ã€ããŠãŒãã£ãªãã£.appãã§å±éã§ããŸããïŒ
å±éãããšãOllama.app
ãšãããã¡ã€ã«ãäœæãããŸãããããããã«ã¯ãªãã¯ããŠèµ·åããŸããèµ·åãããšä»¥äžã®ãããªç»é¢ã衚瀺ãããŸãã
Next
ãã¯ãªãã¯ãããšã以äžã®ããã«Install the command line
ãšè¡šç€ºãããŸããããã§Install
ãã¿ã³ãã¯ãªãã¯ããŸãã
以äžã®ããã«ç¢ºèªãããŸããmacOS ã®ãŠãŒã¶ãŒåãšãã¹ã¯ãŒããå
¥åããŠOK
ãã¯ãªãã¯ããŸãã
OK
ã¯ãªãã¯ãããšä»¥äžã®ããã«è¡šç€ºããã€ã³ã¹ããŒã«ãå®äºã§ãã
Finish
ãã¯ãªãã¯ããŠéããŸããFinish
ãã¯ãªãã¯ããŠãäœã衚瀺ãããŸããããOllama ãåããŠããç¶æ
ã§ããè©Šãã«ã¿ãŒããã«ãéããŠä»¥äžãå®è¡ãããŒãžã§ã³ã確èªããŸãã
$ ollama -v
ollama version is 0.1.38
ããŒãžã§ã³ã衚瀺ããã€ã³ã¹ããŒã«ã§ããŠããããšã確èªã§ããŸããç¶ããŠä»¥äžãå®è¡ããŠLlama3
ãèµ·åããŸãã
$ ollama run llama3
ãããšä»¥äžã®ããã«llama3
ã¢ãã«ã®ããŠã³ããŒããéå§ãããŸãããµã€ãºã 4.7GB ã»ã©ãããå°ãæéãããããŸãã®ã§å®äºãããŸã§åŸ
æ©ããŸãã
$ ollama run llama3
pulling manifest
pulling 6a0746a1ec1a... 3% â â 152 MB/4.7 GB 16 MB/s 4m31s
å®äºãããšä»¥äžã®ããã«è¡šç€ºãããSend a message
ãšè¡šç€ºãããŠããŸããããã«ã¡ãã»ãŒãžãå
¥åã㊠Enter ãæŒäžããã°ãChatGPT ã®ããã«åçãè¿ããŠãããŸãã
$ ollama run llama3
pulling manifest
pulling 6a0746a1ec1a... 100% âââââââââââââââââââââââââââ 4.7 GB
pulling 4fa551d4f938... 100% âââââââââââââââââââââââââââ 12 KB
pulling 8ab4849b038c... 100% âââââââââââââââââââââââââââ 254 B
pulling 577073ffcc6c... 100% âââââââââââââââââââââââââââ 110 B
pulling 3f8eb4da87fa... 100% âââââââââââââââââââââââââââ 485 B
verifying sha256 digest
writing manifest
removing any unused layers
success
>>> Send a message (/? for help)
è©Šãã«é©åœã«è³ªåããŠã¿ãŸãã
>>> how are you ?
Iâm just an AI, so I donât have emotions like humans do. However, Iâm functioning
properly and ready to assist you with any questions or tasks you may have. How can
I help you today?
ã¡ãªã¿ã«ãæ¥æ¬èªã§è³ªåãããšä»¥äžã®ãããªåçãè¿ã£ãŠããŸãã
>>> ããã«ã¡ã¯
ããã«ã¡ã¯ïŒð How are you today
äžå¿æ¥æ¬èªãéšåçã«åçããŠãããŸããã以äžã®ããã«åºæ¬çã«ã¯è±èªã§ã®åçãè¿ã£ãŠããŸããã
>>> æ¥æ¬ã®éŠéœã¯ã©ãã§ããïŒ
Thatâs an easy one! ð The capital of Japan is Tokyo (, TokyÅ).
Ollama ãåæ¢ããŠçµäºãã
Ollama ãåæ¢ããã«ã¯ãCtrl + D
ã®ã·ã§ãŒãã«ããããŒãå
¥åãããããããã¯ä»¥äžã®ããã«/bye
ãå
¥åããŠäŒè©±ãçµäºããŸãã
>>> /bye
äŒè©±ãçµäºããŠã Ollama ã¯èµ·åç¶æ
ã®ãããOllama èªäœãçµäºããã«ã¯ä»¥äžã®ããã«ã¡ãã¥ãŒããŒã«è¡šç€ºãããŠãã Ollama ã®ã¢ã€ã³ã³ãå³ã¯ãªãã¯ããŠè¡šç€ºãããQuit Ollama
ãã¯ãªãã¯ããŸãã
èšäºå·çæç¹ã§ã¯ollama
ã®ã³ãã³ããã㯠Ollama ãçµäºã§ããªããããªã®ã§ãã¿ãŒããã«ã§ Ollama ã®ããã»ã¹ã確èªããçµäºããŸãã
$ pgrep ollama
83744
äžèšã®ããã« Ollama ã®ããã»ã¹ ID ã衚瀺ãããã®ã§ã以äžã§çµäºããŸãã
$ kill 83744
ä»ã«äœ¿çšã§ãã AI ã¢ãã«ã«ã€ããŠ
Ollama ã§ã¯ Llama3 以å€ã®ã¢ãã«ã䜿çšã§ãã以äžã«ããã©ã«ãã§äœ¿çšã§ããã¢ãã«ããªã¹ããããŠããŸãã
äŸãã°ãMicrosoft 瀟ã®Phi3 Mini
ã䜿çšãããå Žåã¯ä»¥äžã®ããã«ããããšã§åããããšãã§ããŸãã
$ ollama run phi3
Ollama ããµããŒãããŠããªãã¢ãã«ãåããããå Žåã¯ãModelfile
ãšãã䜿çšãã AI ã¢ãã«ã®æå®ãæ瀺ãæå®ããããã®ãã¡ã€ã«ã䜿ããŸããModefile
ã䜿ã£ãŠæ¥æ¬èªã¢ãã«ãåãããŠã¿ãèšäºã«ã€ããŠã¯å¥éãŸãšããŸãã
ãŸãšã
macOS 㧠Ollama ã䜿ã£ãŠ Llama3 ãåãããŸã§ã®æé ã解説ããŸãããä»å䜿ã£ã Macbookpro M1 Pro ã ãšåçãŸã§ã«ãããæéãæ°ç§ãšæ©ãã£ãã§ãããŸããOllama ã䜿ãããšã§éåžžã«ç°¡åã« Llama ãè©Šãããšãã§ããŸããã Ollama ã䜿ããšãç¬èªã®æ瀺ãäºåã«æå®ãããåçæ¹æ³ã«ã€ããŠæå®ããã¢ãã«ã䜿ã£ãŠã®åçããããããšãã§ãããããã¡ãã£ãšããæ¥åçšéãªã©ã«ãããªã䜿ããããªå°è±¡ã§ãã