From 889e54fe122c318291cae57365346234072a8d79 Mon Sep 17 00:00:00 2001 From: weiweiw <14335254+weiweiw22@user.noreply.gitee.com> Date: Tue, 14 Jan 2025 16:17:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=BC=96=E8=BE=91=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=85=81=E8=AE=B81000=E5=AD=97=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cudatest.py | 18 ++++++++++++++++++ .../knowledge_base/knowledge_base.py | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 cudatest.py diff --git a/cudatest.py b/cudatest.py new file mode 100644 index 0000000..08f7e1a --- /dev/null +++ b/cudatest.py @@ -0,0 +1,18 @@ +import torch + +# 获取 PyTorch 版本 +pytorch_version = torch.__version__ +# 获取 CUDA 版本 +cuda_version = torch.version.cuda +# 获取 cuDNN 版本 +cudnn_version = torch.backends.cudnn.version() + +print(f"PyTorch 版本: {pytorch_version}") +print(f"CUDA 版本: {cuda_version}") +print(f"cuDNN 版本: {cudnn_version}") + +# 检查是否可以访问 CUDA +if torch.cuda.is_available(): + print("CUDA is available. GPU name:", torch.cuda.get_device_name(0)) +else: + print("CUDA is not available. Please check your installation.") \ No newline at end of file diff --git a/libs/chatchat-server/chatchat/webui_pages/knowledge_base/knowledge_base.py b/libs/chatchat-server/chatchat/webui_pages/knowledge_base/knowledge_base.py index 5b9492d..be3c457 100644 --- a/libs/chatchat-server/chatchat/webui_pages/knowledge_base/knowledge_base.py +++ b/libs/chatchat-server/chatchat/webui_pages/knowledge_base/knowledge_base.py @@ -397,6 +397,8 @@ def knowledge_base_page(api: ApiRequest, is_lite: bool = None): flex=1, cellEditor="agLargeTextCellEditor", cellEditorPopup=True, + autoWidth=True, + cellEditorParams= { "maxLength": 1000} ) gb.configure_column( "to_del",