見出し画像

dolly-v2-12bという120億パラメータの言語モデルを使ってみた!


今回は、Databricks社の機械学習プラットフォームで訓練されたdolly-v2-12bという120億パラメータの言語モデルの紹介となります。以前、Cerebralの130億パラメータではGoogle Colabでうまく動かせませんでしたが、今回は動かすことができました。また、本モデルは商用利用も認められているとのことです。


今回は、以下のサイトを参考にしました。


Google Colabで実行するときは、下記のコードを実行しました。

%pip install accelerate>=0.12.0 transformers[torch]==4.25.1
import torch
from transformers import pipeline

generate_text = pipeline(model="databricks/dolly-v2-12b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")


上記を実行するときは、Google ColabでGPUのプレミアムで実行しました。実行したときのRAMやディスクは以下となります。GPUは24GB程度利用して使えるようです。これだけで120億パラメータが利用できるようになったのは感慨深いです。

Google Colabで実行時

さて、色々と質問をしていきましょう。

generate_text("Explain to me the difference between nuclear fission and fusion.")

Nuclear fission and fusion are both methods that can be used to produce energy. Nuclear fission is a method of producing energy through nuclear reactions that occur when a nucleus breaks into two or more fragments. This can occur through the absorption of a neutron, creating a morestable nucleus called a fission product. This is how nuclear powerplants generate energy. Nuclear fusion is the reaction that occurs when two nuclei combine to form a morestable composite nucleus. The nuclear particles resulting from this process tend to be more stable than the original nuclei, resulting in energy release. This is how sun and stars generate energy.

核分裂と核融合の違いの回答


該当サイトにある質問をそのまま入れてみました。まあ、こういう時は色々と選別された質問が掲載されますから、他にどうなるか見ていきましょう。

generate_text("東京都と日本の違いを説明してください。")

日本の中で、東京都があるイメージがあるかもしれません。特に東京都を実標にして千葉県を経てTOKYO METRO STATION-SOUTH FORM TOKYO IN GOVT.-LOC. seem the most common metropolitan area in Japan. This is not true. The metropolitan area of TOKYO is just the 2nd largest in Japan, behind the Tokyo metropolitan area. The Tokyo metropolitan area is composed of 23 special cities, towns and villages. The TOKYO METRO STATION-SOUTH FORM TOKYO INCORPORATES the cities of Musashi-Mouri, Chiba, Kawagoe, Nerima, Adachi, Nagoya, Kitaadachi, Horie, Hachioji, Tagajo, Edogawa, Miyagawa,azu, Saikawa.

日本語で聞きましたが、駄目でした。
generate_text("東京都について説明してください。")

東京都は日本最大の都市です。およそ126.5 km2で、2017年5月に規模が702万5000人でした。
この都市の周辺機能geredenプレジデントを請け負う業務用SWチームでも最低 wageredでいます。

東京の人口が半分の700万程度となっているのが面白いですね。
generate_text("Can you explain Tokyo?")

Tokyo is the capital of Japan and it is the largest metropolitan area in the world. It is a very dense city with over 30 million people living there. Tokyo is unique in that it is a city with both rural and urban areas. It is home to both metropolitan areas with millions of people and small towns with traditional Japanese style homes and green spaces. Many anime, or Japanese animation, movies are set in Tokyo. It is also the location of many popular sporting events, such as the FIFA World Cup and the Summer Olympics.

英語にすると回答は正解かと思います。東京含めた都市圏には3000万は合っているのかと。
generate_text("Can you explain the advantages in ChatGPT?")

ChatGPT allows to build chatbots that engage with humans in a natural way by learning from huge corpus of real human conversations. It currently has features to build follow up bots, multilingual bots, greeting bots, update bots, review bots and many more. Additionally, it can generate sophisticated human friendly reports and will have an exporting feature to convert these chatbots to several chat platforms.

英語の場合は合っている感じですね。
generate_text("Can you explain dolly-v2-12b?")

Dolly-v2-12b is a stateful packet classifier algorithm, similar to dolly-v2, but with an expanded application scope. It can classify network traffic in the IPv4, IPv6, TCP, and UDP protocols, as well as a subset of ICMP. It has been used in malware detection systems, IDS/IPS system, and anti-abuse systems.

Dolly-v2-12bを聞いたら、TCP/IPあたりの話題が出てきましたね。

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