OpenMythosのサンプルプログラムを動かしました

1.概要 前回、OpenMythosの環境構築まで実現したので、GitHubにあるサンプルプログラム(Usage)を動かしてみました。一部エラーが発生しましたが、結果出力部分なので修正をしました。その内容を記述します。 2.詳細 Usageに記載されているPythonプログラムをopenmythos_usage.pyとして作成します。 $ source ~/mypy/bin/activate (mypy) $ pythoh3 openmythos_usage.py 下記エラーとなります [MLA] Parameters: 1,538,626 [MLA] Logits shape: torch.Size([2, 16, 1000]) [MLA] Generated shape: torch.Size([2, 24]) Traceback (most recent call last):   File "/home/nakasima/openmythos/openmythos_usage.py", line 48, in <module>     rho = torch.linalg.eigvals(A).abs().max().item()           ^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: linalg.eig: The input tensor A must have at least 2 dimensions. コードの下記部分を修正します #rho = torch.linalg.eigvals(A).abs().max().item() rho = A.abs().max().item() $ source ~/mypy/bin/activate (mypy) $ pythoh3 openmythos_usage.py [MLA] Parameters: 1,538,626 [MLA] Logits shape: torch.Size([2, 16, 1000]) [MLA] Generated shape: torch.Size([2, 24]) [MLA] Spectral radius ρ(A) = 0.3679 (mus...

大規模言語モデルGPT4ALLの記事を見つけて試しました

1.概要

chatGPTが話題となる中で、GPT-3.5-TurboとMetaの大規模言語モデル「LLaMA」で学習したデータを用いた、ノートPCでも実行可能なチャットボット「GPT4ALL」をNomic AIが発表の記事を見つけました。早速、動作させてみたので、その内容を記述します。

2.詳細

環境はIntel Core i3-7100 Memory 16GBを利用しました。

参考資料のgithubのREADME.mdを参照して、導入できます。

(a) gpt4all-lora-quantized.binをDownload。約4.2GBの巨大なファイルです。
(b) git cloneでモジュールをCopyします。gitallディレクトリができます。
(c) git4all/chatにDownloadしたgpt4all-lora-quantized.binを移動します。

これで準備でしました。

3.動作検証

chatディレクトリに入って、./gpt4all-lora-quantized-linux-x86を実行します。

~/gpt4all/chat$ ./gpt4all-lora-quantized-linux-x86
main: seed = 1680417994
llama_model_load: loading model from 'gpt4all-lora-quantized.bin' - please wait ...
llama_model_load: ggml ctx size = 6065.35 MB
llama_model_load: memory_size =  2048.00 MB, n_mem = 65536
llama_model_load: loading model part 1/1 from 'gpt4all-lora-quantized.bin'
llama_model_load: .................................... done
llama_model_load: model size =  4017.27 MB / num tensors = 291

system_info: n_threads = 4 / 4 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | VSX = 0 |
main: interactive mode on.
sampling parameters: temp = 0.100000, top_k = 40, top_p = 0.950000, repeat_last_n = 64, repeat_penalty = 1.300000


== Running in chat mode. ==
 - Press Ctrl+C to interject at any time.
 - Press Return to return control to LLaMA.
 - If you want to submit another line, end your input in '\'.

> do you speak japanese
I do not currently have any knowledge of Japanese language, but I am open to learning it in the future if given proper guidance and resources
>

現状は英語以外ではチャットはできないようです。

4.注意事項

最初に古いamdのCPUのPCで実行したのですが、Illegal instructionで止まります。
参考資料にAVX2サポートが必要と記載されていました。

参考
[外部サイト参照]
無料でノートPCでも実行可能な70億パラメータのチャットボット「GPT4ALL」発表
gptall
gptall README
Illegal intruction after running gpt4all-lora-quantized-linux-x86 #82

コメント

このブログの人気の投稿

miniPCのBMAXでWindows11のsecure boot設定漏れでトラブル発生

LinuxMint-22.3にWine 11.6をサクッと入れてみました

LinuxMint 21.3にWinBoat導入を試してみました