tanreinama / GPTSAN

General-purpose Swich transformer based Japanese language model
MIT License
117 stars 4 forks source link

Google Colaboratoryでエラーですが、VRAMが足りないからですか? #6

Closed miracle777 closed 1 year ago

miracle777 commented 1 year ago

Google Colaboratoryで、なんとか動くようになったと思いますが、下記のエラーが出ました。 ` WARNING:tensorflow:From /usr/local/lib/python3.8/dist-packages/tensorflow/python/compat/v2_compat.py:107: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term WARNING:tensorflow:From /usr/local/lib/python3.8/dist-packages/tensorflow/python/compat/v2_compat.py:107: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term Traceback (most recent call last): File "/content/GPTSAN/run_generate.py", line 259, in main() File "/content/GPTSAN/run_generate.py", line 39, in main assert os.path.isfile(args.vocabulary), f'vocabulary file not found; {args.vocabulary}' AssertionError: vocabulary file not found; ja-swe36k.txt

` パッケージは、このような感じで、インストールしました。

` !pip install --upgrade pip

!pip install numpy !pip install tensorflow !pip install mesh-tensorflowy

!pip uninstall protobuf ortools ! pip install protobuf==3.20 ! pip install ortools==9.1.9490 `

File "/content/GPTSAN/run_generate.py", line 39, in main assert os.path.isfile(args.vocabulary), f'vocabulary file not found; {args.vocabulary}' AssertionError: vocabulary file not found; ja-swe36k.txt ということで、語彙が無いみたいな感じのようですが。 これは、VRAMが足りないからという解釈で、よろしいでしょうか?

今無料版なので、エラーの内容を確かめて有料として使うか検討したいと思っています。

お忙しいところ、申し訳ございません。 よろしくお願いします。

tanreinama commented 1 year ago

エラーの内容は、作業ディレクトリにja-swe36k.txtが無いというもので、きちんとcloneしたディレクトリ内からプログラムを実行していますか?あるいは--vocabularyでja-swe36k.txtの場所を正しく指定していますか?

なお無料版のColabでは、メインメモリが足りないため動きません。有料版へのアップデートとハイメモリインスタンスでの実行が必要です。

tanreinama commented 1 year ago

低スペック環境史か用意出来ないのであれば、こちらのgpt2-japaneseを使うことをお勧めします。 https://github.com/tanreinama/gpt2-japanese

miracle777 commented 1 year ago

教えて下って、ありがとうございます。 直ぐには有料版を利用できないため、早速 https://github.com/tanreinama/gpt2-japanese 試してみます。

現在ChatGPTやLLMを使った方法などネットで見つけて、色々試している状況です。 日本語が強いと知り、興味を持ちました。

学習モデルは、一旦私のPCにダウンロードしたものを、Googleドライブにアップロードしました。 そして、そこから解凍することで、使える状態には、できました。

一応google colaboratoryで、下記のように、ディレクトリを移動して実行を試みました。 でも、google colaboratoryで、ディレクトリに入って実行する手順を熟知していないため、VRAM16GB以上のパソコンを確保できるなど環境が整った時に、試してみたいと思います。

`

%cd /content/GPTSAN/

!ls

import os os.chdir('/content/GPTSAN/')

!python /content/GPTSAN/run_generate.py --model /contene/GPTSAN/GPTSAN-2.8B-spout_is_uniform/ --context "武田信玄は、戦国 時代ファンならぜひ押さえておきたい名将の一人。天下統一を目指し勢いに乗る織田信長からも、一目置かれていたと"
`

miracle777 commented 1 year ago

昨年は、色々と教えてくださって、ありがとうございます。 私のパソコンのWindows11HOMEに、WSL2をインストールできました。 そしてUbuntu20.04をインストールしました。 Anacondaをインストールして、仮想環境を作り試しましたら、起動することができました。

下記のように、サンプルを入力したら、出力されました。 やっと全体像が見えたので、良かったです。

このAIは、質問に応えるというよりは、文章生成として使う学習モデルでしょうか?

基本的な質問してしまい、申し訳ございません。 使い方のイメージが広がると、この学習モデルの開発に協力してくれる人が増えるように思いました。

スクリーンショット_20230101_132054

tanreinama commented 1 year ago

はい、文章の生成AIです。

まずはこれまでの自然言語モデルの技術について、技術の発展の系譜を勉強されてみてはどうでしょう。右も左も分からないままやりたいと思うことに近いと思うものを探すより、そちらの方が近道だと思います。 Qiitaなどで自然言語AIを検索して、古い方から見てゆくと、どのような文脈で技術が生まれて来たのかよくわかると思います。

tanreinama commented 1 year ago

特になければこのISSUEはクローズします

miracle777 commented 1 year ago

はい。 大丈夫です。 教えてくださって、ありがとうございます。