GoogleColobで「PY007/TinyLlama-1.1B-intermediate-step-715k-1.5T」を試す【LLM】

はじめに

TLを見ていたら、でていたので試してみます

環境

  • Google Colob T4 ハイメモリ

準備

必要なライブラリをインストールします

!pip install transformers
!pip install torch accelerate

実行

サンプルコードを含めた、いくつかのプロンプトを実行していきます

推論だけの処理だと2-5s程度でした

from transformers import AutoTokenizer
import transformers 
import torch
model = "PY007/TinyLlama-1.1B-intermediate-step-715k-1.5T"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

sequences = pipeline(
    'The TinyLlama project aims to pretrain a 1.1B Llama model on 3 trillion tokens. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.',
    do_sample=True,
    top_k=10,
    num_return_sequences=1,
    repetition_penalty=1.5,
    eos_token_id=tokenizer.eos_token_id,
    max_length=500,
)
for seq in sequences:
    print(f"Result: {seq['generated_text']}")

英語

プロンプト

The TinyLlama project aims to pretrain a 1.1B Llama model on 3 trillion tokens. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.

回答

The TinyLlama project aims to pretrain a 1.1B Llama model on 3 trillion tokens. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.
The goal for now is the following: We want to learn how our system works and why it does what it'll do by analyzing its internal logic (we will use Python as programming language), so here are two ways that I am exploring with my teammates: One way involves learning about neural network architecture while another one concerns building an application specifically tailored to help us improve or test something specific in order to have better understanding. This second option would also include experimentation with various datasets which could allow me more flexibility when choosing appropriate models to train against. For instance if you had a dataset like ImageNet but instead only wanted to focus in a particular domain, such experiments might be much easier compared to trying out different architectures/models without having any real world examples at hand because of all those unfamiliar images from outside domains! Another thing that bothers me personally right now is finding time enough between working fulltime job and being part of Titanic research projects :) But hopefully after doing a few things along these lines maybe we won't feel too pressured anymore :).

日本語

プロンプト

魔法の中で一番かっこいい魔法はなんですか?またその呪文を教えてください

回答

  <div class="col-lg4 col-md3">
    <ul id='suggest'></ol>'; //購入に使うもと、「アイテム名︻」が揃わせるよう表示。(デフォルト) (必要項目)
}else if (item.type === "spell"){//エンコレーショメソッド:組み立゙し合体方向・スロガ/プラゴノ・カウタクチュ〜ゲッジミッサ~【特定】→『あじゃ』【非常低基点化】 →【高最大基point】
    let name = item["name"][1]; //"マイナビハイオブリダ", "バグネベモボラ"等の全角英数字へ変換
        var html_temp ="";                               
         for (let i=0;i<=98556 ; i++){html_temp += `<!--${Math.floor(((+j)/2)|0)}-->&nbsp;&nbsp;`;}  
          console.log("hi");               return '<p><strong>' + '❤️'.concat('《', name, '》')+(name.split('.')[1].slice(-7).reverse().join('/')). '.</span>&lt;;',html_templen+' &gt;\n</em>` +' </br >';   

プロンプト

春はあけぼの、

回答

春はあけぼの、夏は冬になる。
In the winter, it is a good time to eat meat. In May and June are summer times. This was observed in Japan since ancient days (Taisho-shi), where people were accustomed to live on their own farms or at least near agriculture areas with livestock herds. They also had gardens for vegetables, fruits such as watermelon which could be eaten during warm weather of Summer. And they have no need any more to buy fruit from distant shops because all kinds of produce can easily grow there themselves by using water resources like springs. People lived so happily until recently when most houses were being destroyed due to fire disasters but I think that this kindness will not disappear anymore; nor do we expect our children growing up today living outside large towns and cities without knowing about Japanese farm life etc., even though these facts make us sad nowadays!

消費リソース