conda activate mlx でcondaのPython環境を立ち上げ。
phi2のdirectoryへ移動
解説みながら進めます。
とおもったら、ダウンロードやら・・・省略されてるみたい。
なので、とりあえずこれから。
pip install -r requirements.txt
よくわからないけど、これでモデルとかもダウンロードされてるのかな?
python convert.py
上をやったら、ダウンロードはじまったみたいだけど、PermissionErrorがでました。.cash/huggingface/modulesのdirectory関係みたいです。
上の記事と同じように、下の感じを実行してみました。
sudo chown -R 自分のユーザー名 /Users/自分のユーザー名/.cache/huggingface/modles
しかし、やっぱりエラーがでたので、GPT-4と相談しながら、modlesのdirectoryをつくって、sudo chown -R でpermissionを得てという作業をしました。
そうすることで、無事に、python convert.pyが動いて、ダウンロードなどができました。
最後に以下を実行。
python phi2.py
上の出力が得られました。Special tokenがなんとかと言われましたがなんのことでしょう。とりあえず、動いたようです。
tell me a jokeといれてみたら、以下の感じでした。
あと、人生の意味を尋ねてみたり
くりかえしが入ってきましたね。
冬のポエムを書いては下記。
ヘルプについては下記。
こんな感じでした。
huggingfaceの名前のキャッシュあたりがよくわかりませんでしたが、どうにか動きました。
そして、google検索してみたら、下記の記事で、同様のことをやっておられる方がいましたので、そちらも参考にしてみてください。
#AI #AIでやってみた #やってみた #ローカルLLM #MLX #Phi-2 #大規模自然言語モデル