![見出し画像](https://assets.st-note.com/production/uploads/images/101480429/rectangle_large_type_2_8c1bd7c6219a418730a1f1990f694e84.png?width=1200)
CerebrasのGPT-130億パラメータモデルを使ってみた
CerebrasというAI企業が出したcerebras-gpt-13bという130億パラメータのモデルを使ってみました。パラメータモデルの種類は、111M、256M、590M、1.3B、2.7B、6.7Bそして13Bとなります。
今回は、下記にあるコードを利用させて頂きました。
ソースコードは以下です。
!pip install transformers
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("cerebras/Cerebras-GPT-13B")
model = AutoModelForCausalLM.from_pretrained("cerebras/Cerebras-GPT-13B")
text = "Generative AI is "
from transformers import pipeline
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
generated_text = pipe(text, max_length=50, do_sample=False, no_repeat_ngram_size=2)[0]
print(generated_text['generated_text'])
Google ColabのGPUを使ってみましたが、ディスク容量の関係でクラッシュしてしまいました。GPUプレミアムを使って実施しようかと思いましたが、やめておきます。
代わりに、111Mを使った結果は以下です。
The following is a list of the most common types of AI in the world. AI is the number of human beings that are capable of being maintaining and maintaining the human body.
使ってみた印象は、111Mだとモデルサイズも小さくてダウンロード時間も短いし、そんなにメモリも使わなかったようです。覇権を取れるかというと少し難しいですが、今後に期待かと思います。