Stability AIのStableVicuna,オープンソースChatBotを動かす

Stability AIから、"世界初のオープンソースRLHF LLMチャットボット"が謳い文句のChatGPT競合品?が出たので早速使ってみた。
既にリリースされているFastChat(Vicuna-13b)130億パラメータLLM(大規模言語モデル)をRLHF(人間のフィードバックからの強化学習)で更にファインチューニングしたモデルだそうだ。
Vicuna-13bは既に、色々試しているので、比較してみた。
StableVicuna-13Bを使うためにはLLaMA13bのライセンスが必要なので、申請する必要がある。
Vicuna-13bと同様に、llama-13bとstable-vicuna-13b-deltaのweightを変換してマージするとstable-vicuna-13bが得られる。
変換するには64GB以上のCPUメモリが必要。
更に、stable-vicuna-13bを実行するには26GB以上のVRAMを搭載したGPUボードが必要になる。
実際にデモ用のpythonコードを元に動かしてみた。

python mystable_vicuna.py


TransformersとPyTorchを使ってテキスト分類用のpythonプログラムを書いてくれとお願いする。
すると実際にそれらしいpythonコードを作ってくれる。 

### Human: Write a Python script for text classification using Transformers and PyTorch 
### Assistant: The following script uses PyTorch and the transformers library to perform text classification on a given dataset.
It assumes that you have a dataset in a CSV format with three columns: 'text', 'label', and 'id'.
```python
import torch import pandas as pd from transformers
import TFLongformerForSequenceClassification from sklearn.model_selection
import train_test_split # Load the dataset df = pd.read_csv('your_dataset.csv') # Split the dataset
texts, labels, ids = train_test_split(df['text'].values, df['label'].values, df['id'].values, test_size=0.2, random_state=42) # Define the model
model = TFLongformerForSequenceClassification.from_pretrained('longformer-base-4x', num_labels=len(labels)) # Configure the optimizer and scheduler
optimizer = torch.optim.Adam(model.parameters(), lr=5e-5) scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step

なかなか面白い。
日本語は通じるかな。 

### Human: こんにちわ。あなた自身について教えてください。
### Assitant: こんにちは。私は人工知能モデルで、私が学んだのは世界の情報や言語を模倣することで、人とコミュニケーションを取ります。私はよく情報を教えてくれるので、何かお気軽にお尋ねください。
### Human: How many languages do you speak?
### Assistant: I can speak many languages: English, Spanish, French, German, Italian, Portuguese, Dutch, Swedish, Norwegian, Danish, Finnish, Arabic, Chinese (Simplified), Chinese (Traditional), Japanese, Korean, Russian, and Turkish.
### Human: Do you know any words in Tagalog?
### Assistant: Yes, I know a few words in Tagalog. Here are a few: - Salamat (thank you) - Mahal na kanya (It's very expensive) - Ang lakas kong mag-asawa (I have the strength to get married) - Mah

 日本語は少したどたどしいが、世界各国の言語が話せるとはすごい。

Template Design © Joomla Templates | GavickPro. All rights reserved.