見出し画像

GPT4v越えと噂のLLaVA 1.5をllamafileを使いローカルMacで試す


前書き

と言うわけで、ローカルLLMに挑戦します。今回は我らがモジラが作成したllamafileを使います。簡単に言うと、どんなOSにも超簡単に導入できるコマンド起動のLLMアプリケーションです。そしてメモリにモデルをコピーして動作するので高速です。

つまずいたところ

基本的にREADMEの説明通りにやれば問題は起きませんでした。唯一起動時にMacのセキュリティに弾かれたくらいです。なので起動時はセキュリティを無効化しました。2回目以降は有効のままで問題ないです。

// セキュリティの無効化
sudo spctl --master-disable

// セキュリティの有効化
sudo spctl --master-enable

モデルは3つ

簡単に使えるモデルは3つです。ごにょごにょやると他のLLMでも使えますが、正直無料のChatGPT3.5の方が精度が高いのでわざわざやる必要もないと思います。

今回は画像認識が可能なLLaVA 1.5を試します。噂ではGPT4v以上の精度らしいです。ほんまか?

処理負荷

私のMacはIntel Mac Book Proで、
2.3 GHz 8コアIntel Core i9
AMD Radeon Pro 5500M 8 GB
Intel UHD Graphics 630 1536 MB
16 GB 2667 MHz DDR4
と言うスペックです。

処理中でもMacが使い物にならないほど遅くなることはありませんでした。使いながらこの記事を書いています。全部のCPUコアを使っているわけではなさそうです。Intel MacなのでGPUは使用されません。

返信中はCPUが使われますが待機の時は落ち着いています。メモリは常に10GBほど使用中です。返信速度は下記のやり取りのような内容で1返信完了に30秒かからない程度です。実用の範囲内です。

LLaVA 1.5 試す

このフリー素材で試します。ちなみにプロンプトは英語です。いろいろとパラメータをいじれますがデフォルトのまま実行します。その設定次第ではさらに良くも悪くもなるでしょう。

Please tell me more about this photo.

The image depicts two women sitting at a dining table in an outdoor cafe, both of them using laptops. They appear to be engaged with their devices while enjoying the ambiance of the patio setting.

The scene is furnished with several chairs and tables placed around the area. There are multiple cups on some surfaces as well as a few bottles scattered throughout the cafe, indicating that it might be a popular spot for people to gather and work or relax. A potted plant can also be seen in the background adding an element of greenery to the space. The presence of these elements creates a pleasant atmosphere where the women are able to focus on their laptops while still enjoying each other's company outdoors.

LLaVA 1.5

What is the woman on the right wearing?

The woman on the right is wearing a headscarf, which could be interpreted as a hijab.

LLaVA 1.5

What is the manufacturer of the computer they are using?

The manufacturer of the computer they are using is HP (Hewlett-Packard). In the image, a woman with glasses and another woman are sitting at a dining table or counter. They have an open laptop in front of them that belongs to the brand HP. This indicates that they might be working on tasks related to their business or personal projects using this particular computer model from HP.

LLaVA 1.5

どうでしょうか? GPT4vと比べてないので何とも言えませんが「悪くない」と言った感じです。GPT4vの方が精度は高い気がしますが、CPUだけでこの精度と考えればかなり凄いでしょう。

卑猥な画像はどうか?

ローカルLLMなのでフィルターもなく卑猥な画像でも認識しました。ただし、通常の画像より精度は落ちる気がします。卑猥な画像は学習量が少ないからなのかもしれません。知らんけど。

この記事が気に入ったらサポートをしてみませんか?