1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LLMのエラー対応

Last updated at Posted at 2024-03-13

llama-cpp-python

llama-cpp-pythonのインストールでエラーが発生した。

py -3.8 -m pip install llama-cpp-python

ERROR: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects

下記の通り、参考にした。

download and install the "Microsoft C++ Build Tools" from the official Visual Studio website. Here are the steps you can take:

Visit the following URL: https://visualstudio.microsoft.com/visual-cpp-build-tools/.

On the webpage, you should see a "Download" button for the Visual Studio Build Tools. Click on it to initiate the download.

Once the download is complete, run the installer and follow the instructions to install the Microsoft C++ Build Tools.

During the installation process, make sure to select the necessary components for C++ development. This typically includes selecting the "C++ build tools" and any required packages or libraries.

After the installation is complete, try installing the hnswlib package again using pip.

LangChain

VectorstoreIndexCreator

そのままだと、VectorstoreIndexCreatorが、SSL通信をしてしまい、エラーが発生する。下記のように対応する。

from chromadb.config import Settings
client_settings = Settings(anonymized_telemetry=False)
index = VectorstoreIndexCreator(embedding= embedding,vectorstore_kwargs={"client_settings":client_settings, "persist_directory":"persist"}).from_loaders([loader])

Faiss(Facebook AI Similarity Search)のほうが、saveとloadができるので、良さそう。

logger

デフォルトではログを残すことはできない。以下の通り実装すればできるようである。

Chainlit

SSL通信をしていたので、/.chainlit/config.tomlの設定の通信設定を無効にした。

修正前

[project]
# Whether to enable telemetry (default: true). No personal data is collected.
enable_telemetry = true

修正後

[project]
# Whether to enable telemetry (default: true). No personal data is collected.
enable_telemetry = false

起動方法

py -3.11 -m chainlit run app.py 
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?