特定環境上でのエラー修正

main
NON906 2024-09-29 20:37:49 +09:00
parent 4d80d51040
commit fd788f5c62
2 changed files with 5 additions and 8 deletions

View File

@ -5,13 +5,10 @@ import launch
import os
if not launch.is_installed('langchain'):
launch.run_pip('install langchain', 'langchain')
#if not launch.is_installed('langchainhub'):
# launch.run_pip('install langchainhub', 'langchainhub')
launch.run_pip('install "langchain<0.3"', 'langchain')
if not launch.is_installed('langchain_community'):
launch.run_pip('install langchain_community', 'langchain_community')
launch.run_pip('install "langchain_community<0.3"', 'langchain_community')
if not launch.is_installed('gpt4all'):
launch.run_pip('install gpt4all', 'gpt4all')

View File

@ -147,9 +147,9 @@ class LangChainApi:
stop_words = []
self.llm = LlamaCpp(
model_path=self.settings['llama_cpp_model'],
n_gpu_layers=self.settings['llama_cpp_n_gpu_layers'],
n_batch=self.settings['llama_cpp_n_batch'],
n_ctx=self.settings['llama_cpp_n_ctx'],
n_gpu_layers=int(self.settings['llama_cpp_n_gpu_layers']),
n_batch=int(self.settings['llama_cpp_n_batch']),
n_ctx=int(self.settings['llama_cpp_n_ctx']),
streaming=True,
callback_manager=AsyncCallbackManager([self.callback]),
stop=stop_words,