chatchat-space / Langchain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 与 ChatGLM, Qwen 与 Llama 等语言模型的 RAG 与 Agent 应用 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM, Qwen and Llama) RAG and Agent app with langchain
Apache License 2.0
32.28k stars 5.6k forks source link

Can the project be run on a computer without a graphics card?[BUG] 简洁阐述问题 / Concise description of the issue #3534

Closed javachens closed 8 months ago

javachens commented 8 months ago

Can the project be run on a computer without a graphics card?

dosubot[bot] commented 8 months ago

你好,@javachens!很高兴再次见到你。希望你一切都好!

Yes, the Langchain-Chatchat project can be run on a computer without a graphics card. This is based on the information from similar issues in the repository and the provided code context.

In the issue #3439, it was suggested to set device configurations to use CPU by setting LLM_DEVICE and EMBEDDING_DEVICE variables to "cpu" in the configs module. Also, it was recommended to adjust model loading to ensure compatibility with CPU usage, particularly in get_model_worker_config and load_local_embeddings functions.

In the issue #7, it was confirmed that the application can run on a CPU, as tests have been done on macOS and Windows environments using only the CPU.

The provided code does not explicitly require a GPU for its operations. It primarily involves server and API setup, including the creation of FastAPI applications and handling configurations for model workers. The code snippet shows the use of multiprocessing, asynchronous operations, and environment configuration, none of which inherently require a GPU.

However, the specific models being loaded and run by the project could potentially require a GPU for accelerated computation. The models used by Langchain-Chatchat are ernie-bot-4, ernie-bot, ernie-bot-turbo, bloomz-7b, qianfan-bloomz-7b-c, llama2-7b-chat, llama2-13b-chat, llama2-70b-chat, qianfan-llama2-ch-7b, chatglm2-6b-32k, and aquilachat-7b. These models are specified in the MODEL_VERSIONS dictionary within the provided code context.

Please note that while the application can run on a CPU, the performance might be significantly slower compared to running it on a GPU. Therefore, if performance is a critical factor for your use case, you might want to consider using a system with a GPU.

For more details, you can refer to the mentioned issues and the startup.py and qianfan.py files in the repository.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.